Last active
August 31, 2015 09:15
-
-
Save yuval-a/f192821551e12faaf2fe to your computer and use it in GitHub Desktop.
XMLHTTP GET Request
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
var url = '/.../'; | |
var req = new XMLHttpRequest(); | |
req.open('GET', url, true); | |
req.onreadystatechange = function () { | |
if (req.readyState == 4 && req.status == 200) | |
console.log(req.responseText); | |
else | |
console.log("Error loading page"); | |
}; | |
req.send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment