title: How to pop up an alert box when the browser's refresh button is clicked?
body: <p>If the user refreshes the page in question it will add another record to the database, so I want to warn the user through an alert box if they really want to refresh the page and if they click ok then the page should be refreshed otherwise if they click cancel it won't be.</p>
  
  <p>How to make this type of alert box appear when the browser's refresh button is clicked in a way that is cross browser compatible?</p>