title: window.unload() won't work in jQuery
body: <p>I'm trying to alert something out after closing page.</p>
  
  <p>A simple <code>window.unload</code> example as below :</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
    &lt;script src="http://code.jquery.com/jquery-1.10.1.min.js"&gt;&lt;/script&gt;
    &lt;script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"&gt;&lt;/script&gt;
    &lt;script src="test.js" type="text/javascript"&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>test.js</strong></p>
  
  <pre><code>$(window).unload( function () { 
      alert("Bye now!"); 
  });
  </code></pre>
  
  <p><strong>P.S :</strong></p>
  
  <p>I have tried javascript too, but doesn't alert anything out !</p>
  
  <p><strong>test.js</strong></p>
  
  <pre><code>window.onunload = function() {
      alert("Bye now!");
  };
  </code></pre>