How can I get the Return value of onBeforeUnload
<p>I want to do a certain action based on, what the user clicks due to onbeforeunload event. For ex, if the user clicks on "stay on current page" then do some action, else do something else.</p>

<p>I am not getting anyway to fetch the return value of onbeforeunload and do some action based on that.  </p>

<p>Any help will be appreciated.</p>
