diff --git a/README.md b/README.md index 788ab5a..41d1792 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,29 @@ - (1 to 5 no 3) I feel good about my code - Anything specific on which you want feedback! -Example: -``` + + I completed the challenge: 5 I feel good about my code: 4 -I'm not sure if my constructors are setup cleanly... -``` + +Get doggy + +press button, get doggie! + +https://justinjoshi.github.io/simple-api2-bootcamp/ + +Tech used: HTML, CSS, JavaScript + +I used a simple fetch request to get doggy! + +Optimizations + +I would get more doggy + +... + +(actually, i would style it a little bit) + +Lessons Learned: + +I learned how to get doggy through doggie api. diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html new file mode 100644 index 0000000..9792d4f --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ + + + + + + Document + + + + +
+ + + \ No newline at end of file diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..4e726a1 --- /dev/null +++ b/js/main.js @@ -0,0 +1,18 @@ +document.querySelector('#first').addEventListener('click', getData) + + +async function getData() { + const url = "https://dog.ceo/api/breeds/image/random"; + try { + const response = await fetch(url); + if (!response.ok) { + throw new Error(`Response status: ${response.status}`); + } + + const result = await response.json(); + + document.querySelector('div').innerHTML += `` + } catch (error) { + console.error(error.message); + } +}