fetch url in javascript
fetch('https://api.github.com/users/kipngetich33')
.then(response => response.json())
.then(formatedResponse => console.log(formatedResponse))
//NB please replace url with your own
fetch url in javascript
fetch('https://api.github.com/users/kipngetich33')
.then(response => response.json())
.then(formatedResponse => console.log(formatedResponse))
//NB please replace url with your own
fetch html from url
fetch('/about').then(function (response) {
// The API call was successful!
return response.text();
}).then(function (html) {
// Convert the HTML string into a document object
var parser = new DOMParser();
var doc = parser.parseFromString(html, 'text/html');
// Get the image file
var img = doc.querySelector('img');
console.log(img);
}).catch(function (err) {
// There was an error
console.warn('Something went wrong.', err);
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us