javascript - Jquery way to handle all ajax success events in one place -
i have scenario need handle jquery success events in common place. because want delegate called after ajax success events. know can use $.ajaxcomplete
or $.ajaxsucess
that. problem ajax calls have own success handlers, $.ajaxsucess overwritten .
and know can write common method can put in ajax success handlers. dont want that, want know cleaner way.
is there method handler in jquery that, or whats best way it?
the $.ajaxsuccess
method should work fine seen in this live demo , doesn't conflict existing ajax success handlers. executed after each of them:
$('#msg').ajaxsuccess(function(result) { alert('ajax succeeded'); });
Comments
Post a Comment