Skip to content

Instantly share code, notes, and snippets.

@CodeOfficer
Created May 25, 2010 22:14
Show Gist options
  • Save CodeOfficer/413762 to your computer and use it in GitHub Desktop.
Save CodeOfficer/413762 to your computer and use it in GitHub Desktop.
;(function($) {
$(function() {
$('body').bind('confirm', function(event) {
console.log('confirm', event);
});
$('body').bind('ajax:before', function(event) {
console.log('ajax:before', event);
// return false; works here to cancel the chain
});
$('body').bind('ajax:loading', function(event, xhr) {
console.log('ajax:loading', event, xhr);
});
$('body').bind('ajax:after', function(event) {
console.log('ajax:after', event);
});
$('body').bind('ajax:success', function(event, data, textStatus, xhr) {
console.log('ajax:success', event, data, textStatus, xhr);
});
$('body').bind('ajax:failure', function(event, xhr, textStatus, errorThrown) {
console.log('ajax:failure', event, xhr, textStatus, errorThrown);
});
$('body').bind('ajax:complete', function(event, xhr) {
console.log('ajax:complete', event, xhr);
});
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment