Global Ajax event handlers that are attached with jQuery.ajaxError
or jQuery.ajaxComplete
don't seem to receive any information about whether a fetch failure is as a result of a time out. Any pointers on how I can detect time outs? Would checking to see if the status
property of the jqXHR object is 0 be a reliable method?
Probably there are some differences how you defined the global jQuery Ajax event handler. You don't posted your code. I tried the following
$(document).bind("ajaxError", function (e, jqXHR, ajaxSettings, thrownError) {
// log the event
});
$(document).bind("ajaxComplete", function (e, jqXHR) {
// log the event
});
with jQuery 1.7.1 and I can see that in case of timeout error always both ajaxError
and ajaxComplete
was called.
You can verify this in the simple demo which display in my tests either
in case of success or
on timeout error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With