Created
May 2, 2015 01:20
-
-
Save yuval-a/84f59d16439d9599185c to your computer and use it in GitHub Desktop.
XMLHttpRequest POST
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 xmlhttp = new XMLHttpRequest(); | |
xmlhttp.open("POST", url, true); | |
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | |
xmlhttp.onreadystatechange = function() { | |
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { | |
alert(xmlhttp.responseText); | |
} | |
} | |
xmlhttp.send("param=bla¶m=bla"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment