title: jQuery AJAX not redirecting?
body: <p>I have a simple PHP page (for testing) that simply calls <code>header("Location: <a href="http://www.example.com" rel="nofollow">http://www.example.com</a>");exit;</code>, which resides on the same server, in the same directory as another file with the following jQuery Javascript:</p>
  
  <pre><code>$(document).ready(function() {
      jQuery.ajax({
          type : 'GET',
          url : 'bounce.php',
          error : function(xhr, status, error) {
              console.log("ERROR: ", xhr, xhr.status, xhr.getAllResponseHeaders());
          },
          complete : function(xhr, status) {
              // Get headers of the response
              console.log("COMPLETE: ", xhr, xhr.status, xhr.getAllResponseHeaders());
          }
      });
  });
  </code></pre>
  
  <p>I was expecting (from several other StackOverflow responses) for the <code>xhr.status</code> to return "302", but instead the AJAX call is triggering the "error" event (and then the "complete" event), and <code>xhr.status</code> is returning <code>0</code> (zero), and <code>.getAllResponseHeaders()</code> is coming back <code>null</code> (in both the error, and complete functions).</p>
  
  <p>Firebug is showing the "302 Moved Temporarily", and the response headers. <strong>So why is this triggering the error event, and not passing along the proper 302 code, and headers?</strong> Is this something to do with the Same Origin since the bouncing script and the fetching script are both on the same server? Is this jQuery or Javascript's fault?</p>