title: javascript beforeunload detect refresh versus close
body: <p>Using the following function is it possible to detect which button the user has 
  pressed the refresh button or the close button? If not is there another way?</p>
  
  <pre><code>$(window).bind('beforeunload', function(event) {
      return 'pls save ur work';
  });
  </code></pre>