Skip to content

Instantly share code, notes, and snippets.

@64lines
Last active August 29, 2015 14:00
Show Gist options
  • Save 64lines/11024148 to your computer and use it in GitHub Desktop.
Save 64lines/11024148 to your computer and use it in GitHub Desktop.
[AJAX] - XMLHttpRequest
function createXMLHttpRequest() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "url"); // Method GET or POST
xhr.onload = function(e) {
console.log(xhr.responseText);
};
xhr.send();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment