Skip to content

Instantly share code, notes, and snippets.

@mokkabonna
Created June 26, 2013 12:54
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 mokkabonna/5867147 to your computer and use it in GitHub Desktop.
Save mokkabonna/5867147 to your computer and use it in GitHub Desktop.
reported by frameworks when browser cancells ajax request
//vermin readystate 4, status 0
vermin.ajax.get('/longrunning', {
failure: function() {
console.log(JSON.stringify(arguments));
}
});
//jquery readystate 0, status 0
$.get('/longrunning').fail(function() {
console.log(JSON.stringify(arguments));
});
//native readystate 4, status 0
var xmlhttp;
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
console.log(xmlhttp.readyState, xmlhttp.status);
};
xmlhttp.open("GET", "/longrunning", false);
xmlhttp.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment