title: Ajax: How to prevent jQuery from calling the success event after executing xmlHttpRequest.abort();
body: <p>Using jQuery's $.ajax() function.  Wherether the request has been purposely aborted, or if the server is down (not responding) it appears the same outcome happens;</p>
  
  <p>That is the  "success" handler gets triggered where <em>xmlHttpRequest.status = 0</em> and <em>xmlHttpRequest.readyState = 4</em>.</p>
  
  <p>(I simulated the failed request by shutting off IIS, and then executing a xmlHttpRequest against the website that had been "turned off")</p>
  
  <p>So my question is how can I determine the difference between an aborted request, or a request that genuinely failed due to the server not responding (because maybe the server is down), since both scenarios appear to give me the same status/readyState?</p>
  
  <p><strong>EDIT</strong>
  More accurately I want to know how to prevent calling the "success" handler after the .abort() function is called on ajax.</p>
  
  <p>I have re-worded the question to reflect this.</p>