title: Page waits for AJAX before changing location
body: <p>This question might seem a bit odd, the problem arised when the page went through webtests.</p>
  
  <p>The page uses an AJAX call (async set to true) to gather some data. For some reason it won't swap pages before the AJAX call has returned - consider the following code:</p>
  
  <pre><code>console.log("firing ajax call");
  $.ajax({
          type:    "POST",
          url:      "requestedService",
          data:     mode : "requestedMethod",
          cache:    false,
          dataType: "json",
          success:  function() { console.log("ajax response received") },
          error:    null,
          complete: null,
      });
  console.log("changing window location");
  window.location = "http://www.google.com"
  </code></pre>
  
  <p>The location only changes after AJAX returns the response. I have tested the call, it is in fact asynchronous, the page isn't blocked. It should just load the new page even if the AJAX call hasn't completed, but doesn't. I can see the page is trying to load, but it only happens once I get the response. Any ideas?</p>
  
  <p>The console output is:</p>
  
  <pre><code>firing ajax call
  changing window location
  ajax response received
  </code></pre>