Created
July 24, 2014 22:43
-
-
Save nabinno/a526cdc2b2ac6e14aa78 to your computer and use it in GitHub Desktop.
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
xhr.onreadystatechange = function() { | |
if (xhr.readyState == 4) { // DONE | |
if (xhr.status == 200) { // OK | |
alert(xhr.responseText); | |
} else { | |
alert("status = " + xhr.status); | |
} | |
} | |
} | |
// GET | |
xhr.open("GET", "hoge.txt"); | |
xhr.send(); | |
//// POST | |
// xhr.open("POST", "hoge.cgi"); | |
// xhr.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded"); | |
// xhr.send("a=b&c=d"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment