title: jQuery AJAX call not working in Webkit
body: <p>I've run into a strange issue with Webkit based browsers (both Safari and Chrome - I'm testing on a Mac) and I am not sure what is causing it.  Here's a small script I've created that replicates the issue:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript"&gt;
  function doRequest() {
    document.test.submit();
    $.ajax({
      type: "GET",
      cache: false,
      url: 'ajax.php?tmp=1',
      success: doSuccess
    });
  }
  function doSuccess(t_data,t_status,req) {
    alert('Data is: '+ t_data +', XMLHTTPRequest status is: '+ req.status);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form name="test" method="post" action="ajax.html" enctype="multipart/form-data"&gt;
  &lt;input type="file" name="file_1"&gt;
  &lt;br&gt;&lt;input type="button" value="upload" onclick="doRequest();"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>ajax.php is:</p>
  
  <pre><code>&lt;?php
  echo $_REQUEST['tmp'];
  ?&gt;
  </code></pre>
  
  <p>This works as is on Firefox, but the XMLHTTPRequest status is always "0" on both Safari and Chrome.  If I remove this line:</p>
  
  <pre><code>document.test.submit();
  </code></pre>
  
  <p>then it works, but of course the form is not submitted.  I've tried changing the form submit button from "button" to "submit", but that also prevents it from working on Safari or Chrome.</p>
  
  <p>What I am trying to accomplish is:</p>
  
  <ul>
  <li>submit the form</li>
  <li>call another script to get status on the file being uploaded via the form (it's for a small upload progress meter).</li>
  </ul>
  
  <p>Any help is really appreciated - I'm hopeful it is just a quirk I'm not familiar with.</p>
  
  <p>Thanks!</p>
  
  <ul>
  <li>Brian</li>
  </ul>