Is it possible to stop the current ajax request from within the jquery global event ajaxStart?
2 Answers
.ajaxStart doesn't have access to the xhr object. .ajaxSend does, however. You can stop it there. I don't know why you would want to do this, but remember that this is a global ajax event -- so this effectively stops all ajax requests(or at least those that don't have the global:false flag).
$('some-object').ajaxSend(function(e, xhr) { xhr.abort(); });