Created
March 22, 2016 14:14
-
-
Save cedeber/ba48c3897ab44bda7c7c to your computer and use it in GitHub Desktop.
AJAX requests
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
var myRequest = new XMLHttpRequest(); | |
myRequest.open("GET", url + ((/\?/).test(url) ? "&" : "?") + (new Date()).getTime()); | |
myRequest.open("POST", "http://www.cedeber.fr/"); | |
myRequest.setRequestHeader("Cache-Control", "no-cache"); | |
myRequest.setRequestHeader("Content-Type", "text/plain"); | |
myRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); | |
myRequest.onload = myOnLoadHandlerFunction; | |
myRequest.send(data||params); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment