title: Catch close/refresh browser event and redirect to another page
body: <p>I have a problem, i don't have to give the user the ability to refresh page because the data will be lost so what i did was block the refresh act using :</p>
  
  <pre><code>$(window).bind('beforeunload', function(e) {
    var message = "Why are you leaving?";
    e.returnValue = message;
    return message;
  };
  </code></pre>
  
  <p>But when the user press reload I need to navigate to another page (don't allow the user to stay on the same page)</p>
  
  <p>thank you</p>