Skip to content

Instantly share code, notes, and snippets.

@JSila
Created December 24, 2014 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JSila/fb7590798b631de34ff4 to your computer and use it in GitHub Desktop.
Save JSila/fb7590798b631de34ff4 to your computer and use it in GitHub Desktop.
simple ajax get request
function get (url, callback) {
var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if (request.readyState == 4 && request.status == 200)
callback(request.responseText)
}
request.open('GET', url, true)
request.send()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment