title: ajax and onbeforeunload
body: <p>I want to inform my server that a user has closed browser tab/window with our app.</p>
  
  <p>I found out that running an ajax call with <code>async:false</code> binded to a <code>window.beforeunload</code> evet will work and it does. Sort of...</p>
  
  <pre><code>window.onbeforeunload = beforeunload;
  
  function beforeunload() 
  { 
      setSendingPowerStatus(false, true);
  
  } 
  </code></pre>
  
  <p>So, in <em>chrome</em> user closes the window and <code>setSendingPowerStatus(false, true);</code> function which in its implementation makes a synchronous call is being executed and when done browser closes the tab. In FF, on the other hand, user is prompted with that alert dialog asking <em>"Are U sure you wanna leave the page?"</em>.</p>
  
  <p>My question is how to execute ajax call on <em>onbeforeunload</em> event without showing any dialog??? I mean I want to execute an ajax call before window is closed without bothering the user...</p>
  
  <p>I also tried to <em>return false</em> also from my handler function, but without luck there either...</p>