I do lots of $.ajax calls, and I handle errors from them in a way that throws up a message. I find that if an ajax call is in progress while the page gets reloaded, e.g. click refresh, or navigate to another URL, then my in-progress ajax calls trigger their error callbacks.
How can I tell the difference between a real error, and a call that aborted because the page got reloaded?
$.ajax(...)
.success(...)
.error(function(jqXHR) {
// jqXHR.status == 0 means either failed to contact server,
// or aborted due to page reload -- how can I tell the difference?
});