Skip to content

Instantly share code, notes, and snippets.

@bradleybuda
Created March 30, 2011 18:21
Show Gist options
  • Save bradleybuda/894933 to your computer and use it in GitHub Desktop.
Save bradleybuda/894933 to your computer and use it in GitHub Desktop.
Instrument all jQuery AJAX events
_.each(['Start', 'Stop', 'Complete', 'Error', 'Success', 'Send'], function(s){
$(window)['ajax' + s](function(event, xhr, options) {
// your instrumentation goes here
console.log('ajax' + s);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment