title: Way to know if user clicked Cancel on a Javascript onbeforeunload Dialog?
body: <p>I am popping up a dialog box when someone tries to navigate away from a particular page without having saved their work.  I use Javascript's onbeforeunload event, works great.</p>
  
  <p>Now I want to run some Javascript code when the user clicks "Cancel" on the dialog that comes up (saying they don't want to navigate away from the page).</p>
  
  <p>Is this possible?  I'm using jQuery as well, so is there maybe an event like beforeunloadcancel I can bind to?</p>
  
  <p><strong><em>UPDATE</em></strong>: The idea is to actually save and direct users to a different webpage if they chose cancel</p>