title: How to get jQuery.ajax response status?
body: <p>Is there any way to know if the jqXHR object returned was redirected from another request? For example, having the following code:</p>
  
  <pre><code>   jQuery.ajax({
              type:       'POST',
              url:        'http://example.com/page.html',
              complete:   function(response, status) {
                          console.log(response.statusCode);
                          // do something
                          }
          });
  </code></pre>
  
  <p>If the ajax url is redirected with a 301 or 302 status code, the response will be the result of the redirected page and will return a 200 (OK) status code. I think this is a jQuery's bug (don't really know if this is the intended beheavior, since the ultimate response was actually succesful)
  I can't either get the original response Headers to check if there exists a Location Header, since this is only available on redirected requests.</p>
  
  <p>Firebug with the above code logs these two requests through XHR</p>
  
  <p><a href="http://example.com/page.html" rel="noreferrer">http://example.com/page.html</a> 302 (Moved temporarily)
  <a href="http://example.com/redirect.html" rel="noreferrer">http://example.com/redirect.html</a> 200 (OK)</p>
  
  <p>But jQuery only return data from the second request.</p>
  
  <p>Maybe there is a way to get data from the first request? Or to get the response url and compare it with the one from the original request?</p>