title: How do I tell if an XMLHttpRequest failed due to a network issue?
body: <p>In web programming (JavaScript, Dart, etc), how can I tell if my XMLHttpRequest (aka AJAX) request failed because of a network error?</p>
  
  <p>I define network error as anything like DNS, TCP, connection issues, etc.</p>
  
  <p>Thanks!</p>