diff --git a/JavaScript/Advance/Web API/fetch API-part2/images/js-logo.png b/JavaScript/Advance/Web API/fetch API-part2/images/js-logo.png new file mode 100644 index 0000000..4637ac9 Binary files /dev/null and b/JavaScript/Advance/Web API/fetch API-part2/images/js-logo.png differ diff --git a/JavaScript/Advance/Web API/fetch API-part2/index.html b/JavaScript/Advance/Web API/fetch API-part2/index.html new file mode 100644 index 0000000..cd8debb --- /dev/null +++ b/JavaScript/Advance/Web API/fetch API-part2/index.html @@ -0,0 +1,19 @@ + + + + + + + + Fetch API- Part-II + + + +

Fetch API Part 2 from url

+

Example

+ +

+ + + + \ No newline at end of file diff --git a/JavaScript/Advance/Web API/fetch API-part2/script.js b/JavaScript/Advance/Web API/fetch API-part2/script.js new file mode 100644 index 0000000..5c96ecc --- /dev/null +++ b/JavaScript/Advance/Web API/fetch API-part2/script.js @@ -0,0 +1,11 @@ +// Fetch API Part 2, Fetching From URL +let textOne = document.getElementById('textOne'); + +function DisplayOne() { + fetch('https://jsonplaceholder.typicode.com/todos/1') + .then(response => { + let resp = response; + textOne.innerHTML = resp; + console.log(textOne); + }); +} \ No newline at end of file