title: Message for reloading a webpage
body: <p>I want to prevent users from reloading the page each time to get updated dynamic content. So I have used this code:</p>
  
  <pre><code>window.onbeforeunload = function() {
          return "Dont need to reload the whole page. Just reload the section";
      }
  </code></pre>
  
  <p>It's working fine except when an user closes the browser's tab/window, the same message is showing also. But I want to show the message only for reloading/F5 button, not for closing the browser's tab/window. What event handler should I have to used for that purpose?</p>