Skip to content

Instantly share code, notes, and snippets.

@notpushkin
Created February 14, 2014 17:19
Show Gist options
  • Select an option

  • Save notpushkin/9005098 to your computer and use it in GitHub Desktop.

Select an option

Save notpushkin/9005098 to your computer and use it in GitHub Desktop.
var ajax = new XMLHttpRequest();
ajax.onreadystatechange = function(){
if(ajax.readyState == 4) {
// the request have successfully finished
alert(ajax.responseText);
}
}
ajax.open("GET", "hello.txt", true);
ajax.send(null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment