title: How to send AJAX request on window unload and NOT have to wait for a response
body: <p>I found that this works sporadically, but usually doesn't work at all.</p>
  
  <pre><code>$(window).unload(function()
  {
      $.ajax
      ({
          url: "script.php",
          type: "POST",
          data: 
          { 
              value: value
          }
      });
  });
  </code></pre>
  
  <p>Setting the async to false (i.e.<code>'async' : false</code>) does get around the problem and executes the php script every time. But depending on the script, it can freeze the browser up for a while. </p>
  
  <p>Is there a good way of sending data to a php script and having the server execute it without the user waiting for a response?</p>
  
  <p><strong>EDIT</strong> - My understanding of client-server interaction is rusty, but it's not the request sending that's taking a long time, it's the processing of the data sent by the request. I'm wondering if that processing can occur without the user having to be on the page at all.</p>