title: Detecting that a jQuery.ajax call failed because the page is reloading?
body: <p>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.</p>
  
  <p>How can I tell the difference between a real error, and a call that aborted because the page got reloaded?</p>
  
  <pre><code>$.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?
  });
  </code></pre>