title: Ajax and status 302
body: <p>I'm having a problem with ajax (and/or jQuery ajax) and status 302.</p>
  
  <p>This is what I am trying:</p>
  
  <pre><code>var xhr = new XMLHttpRequest();
  xhr.open("GET", 'some_page_that_I_cant_change.php');
  xhr.onreadystatechange = function(){
      console.log(xhr.readyState, xhr.status);
  };
  xhr.send(null);
  </code></pre>
  
  <p>The <code>some_page_that_I_cant_change.php</code> redirects to a <code>.bin</code> with <code>302</code> code. I do not want to download this file, I just want know the path to the file. Example:</p>
  
  <pre><code>./some_page_that_I_cant_change.php
  ./path/to/bin/file.bin &lt;&lt; I wan't only this path as string
  </code></pre>
  
  <p>The problem is that Chrome automatically redirects to the file, without telling me the path to script. Is there a workaround for this?</p>