Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // const url = 'https://simple-movie-api-2019.herokuapp.com/movies';
- // fetch(url)
- // .then(function(response) {
- // return response.json();
- // })
- // .then(function(myJson) {
- // console.log(JSON.stringify(myJson));
- // });
- movieTest = () => {
- let xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- let movie = JSON.parse(this.responseText);
- console.log(movie);
- }
- };
- xhttp.open("GET", "https://simple-movie-api-2019.herokuapp.com/movies/", true);
- xhttp.send();
- }
- movieTest();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement