Skip to content

Instantly share code, notes, and snippets.

@dustintheweb
Created April 13, 2015 12:03
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 dustintheweb/4b54045d65ce55411a1f to your computer and use it in GitHub Desktop.
Save dustintheweb/4b54045d65ce55411a1f to your computer and use it in GitHub Desktop.
Javascript to debug an ajax request
var oXhr;
oXhr = new XMLHttpRequest();
oXhr.id = (new Date()).getTime();
oXhr.onreadystatechange = function() {
if (oXhr.readyState === 4 && (oXhr.status === 200)) {
// code stuffs
console.log(this.id);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment