Created
March 28, 2019 16:05
-
-
Save pooya-raz/3c9748245f74b8da5020ece2fe0cb7b3 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/tugituk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
fetch('https://www.googleapis.com/books/v1/volumes?q=isbn:9780826476975') | |
.then( | |
function(response) { | |
if (response.status !== 200) { | |
console.log('Looks like there was a problem. Status Code: ' + | |
response.status); | |
return; | |
} | |
// Examine the text in the response | |
response.json().then(function(data) { | |
console.log(data); | |
}); | |
} | |
) | |
.catch(function(err) { | |
console.log('Fetch Error :-S', err); | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">fetch('https://www.googleapis.com/books/v1/volumes?q=isbn:9780826476975') | |
.then( | |
function(response) { | |
if (response.status !== 200) { | |
console.log('Looks like there was a problem. Status Code: ' + | |
response.status); | |
return; | |
} | |
// Examine the text in the response | |
response.json().then(function(data) { | |
console.log(data); | |
}); | |
} | |
) | |
.catch(function(err) { | |
console.log('Fetch Error :-S', err); | |
}); | |
</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('https://www.googleapis.com/books/v1/volumes?q=isbn:9780826476975') | |
.then( | |
function(response) { | |
if (response.status !== 200) { | |
console.log('Looks like there was a problem. Status Code: ' + | |
response.status); | |
return; | |
} | |
// Examine the text in the response | |
response.json().then(function(data) { | |
console.log(data); | |
}); | |
} | |
) | |
.catch(function(err) { | |
console.log('Fetch Error :-S', err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment