title: Could it be, that Chrome cancels pending Ajax requests, once the browser is being redirected to another URL?
body: <p>I have this function to unlock a list the user is currently editing:</p>
  
  <pre><code>function unsetLock(id) {
    $.ajax({
      type: "POST",
      url: "/ajax.php?action=unsetLock",
      dataType: 'json',
      data: "id="+ id
    });
    return true;
  }
  </code></pre>
  
  <p>When the user navigates away from the list, I have to cancel the lock:</p>
  
  <pre><code>unsetLock(lockID);
  document.location.href='/page/to/navigate/back/to.php';
  </code></pre>
  
  <p>However this unlock sometimes works and sometimes doesn't. I think it is because <code>document.location.href</code> is executed, before the ajax call has actually been sent to the server.</p>
  
  <p>How can I force to send the unlock before navigating the user to the next page?</p>
  
  <p>Actually I don't need to wait for the Ajax-Reply, since I want to redirect the user, whether it succeeds, or not. I just want to make sure, it is being transferred to the server.</p>
  
  <p>If I place the <code>document.location.href</code> inside the Ajax function, it will wait for the reply.</p>