Skip to content

Instantly share code, notes, and snippets.

@izumskee
Created March 17, 2015 11:54
Show Gist options
  • Save izumskee/953a57c24b0135f61783 to your computer and use it in GitHub Desktop.
Save izumskee/953a57c24b0135f61783 to your computer and use it in GitHub Desktop.
XMLHttpRequest example
var httpRequest;
if (window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
} else if (window.ActiveXObject) {
// Internet Explorer
httpRequest = new
ActiveXObject("Microsoft.XMLHTTP");
}
httpRequest.onreadystatechange = function () {
if (httpRequest.readyState === 4 && httpRequest.status === 200) {
callback.call(httpRequest.responseXML);
}
};
httpRequest.open('GET', url);
httpRequest.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment