Created
April 24, 2018 03:18
-
-
Save chongiscool/bc76b544e7d8a68929493414e67e5db4 to your computer and use it in GitHub Desktop.
mark here for learning
This file contains hidden or 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
const xhr = new XMLHttpRequest(); | |
const url = 'https://api-to-call.com/endpoint'; | |
xhr.responseType = 'json'; | |
xhr.onreadystatechange = function () { | |
if (xhr.readyState === XMLHttpRequest.DONE) { | |
//console.log('xhr response', xhr.response); | |
console.log(xhr.response); | |
} | |
} | |
xhr.open('GET', url); | |
xhr.send(); // 'GET' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment