title: How to detect jQuery $.get failure?
body: <p>I'm a jQuery beginner. I'm trying to code a very simple using $.get(). The <a href="http://api.jquery.com/jQuery.get/#" rel="nofollow noreferrer">official documentation</a> says:</p>
  <blockquote>
  <p>If a request with jQuery.get() returns an error code, it will fail silently unless the script has also called the global .ajaxError()  method or.</p>
  <p>As of jQuery 1.5, the .error() method of the jqXHR object
  returned by jQuery.get() is also available for error handling.</p>
  </blockquote>
  <p>So, if all goes well, my callback function for success will be called. However, if the request fails, I would like to get the HTTP code :404, 502, etc and formulate a meaningful error message for the user.</p>
  <p>However, since this is an asynchronous call I can imagine that I might have several outstanding. How would .ajaxError() know which request it corresponds to?  Maybe it would be better to use the .error() method of the jqXHR object returned by jQuery.get()?</p>
  <p>I am seeking an extremely simple code example. Perhaps the success routine calls Alert(&quot;Page found&quot;) and the failure routine checks for 404 and does an Alert(&quot;Page not found&quot;).</p>
  <h2>Update</h2>
  <p>The following page is extremely helpful: <a href="http://api.jquery.com/jQuery.get/" rel="nofollow noreferrer">http://api.jquery.com/jQuery.get/</a></p>