Well, I figured out a way that I really like. Correct the XMLHttpRequest undo method so that it decreases the jQuery ajax counter and starts the handler if it has the last request. Not sure how well it will work in browsers.
var old_abort = XMLHttpRequest.prototype.abort;
XMLHttpRequest.prototype.abort = function(){
jQuery.proxy(old_abort, this)();
if ( jQuery.active-- === 1 )
jQuery.event.trigger( "ajaxStop" );
};
source
share