I want to have a global error handling method for ajax calls, this is what I have now:
$.ajaxSetup({
error: function (XMLHttpRequest, textStatus, errorThro
Because bluecollarcoders answer doesn't work for ajax requests aborted by javascript, here is my solution:
var unloaded = false;
...
$(window).bind('beforeunload', function(){
unloaded = true;
});
$(document).ajaxError(function(event, request, settings) {
if (unloaded || request.statusText == "abort") {
return;
}
...
}
e.g.
handler = jQuery.get("foo")
handler.abort()
will now be ignored by ajaxError handler