title: unload vs java script - onbeforeunload
body: <p>working on a way go recognize when user exits my website.</p>
  
  <p>ive read some threads on the site aboout methods do to this with ajax calls simulating pings</p>
  
  <p>ive found documantation for unload event that will happen before the browser window will close/redirect</p>
  
  <p>question which metod is better ? </p>
  
  <p>the Java script native - <a href="http://chrismckee.co.uk/good-sir-before-you-unload-crossbrowser-javascript-headaches/" rel="nofollow">link</a></p>
  
  <pre><code>window.onbeforeunload
  </code></pre>
  
  <p>or the jQuery - <a href="http://api.jquery.com/unload/" rel="nofollow">http://api.jquery.com/unload/</a></p>
  
  <pre><code>$(window).unload
  </code></pre>
  
  <p>redarding which will be better in browser compatability and catch more events ?</p>
  
  <p>is it reliable or should i go with the Ping to server method ?</p>