Check if User has clicked "Ok" for "onbeforeunload event"
<p>I am checking when the user closes the browser window, if he says ok, how i do I trigger some action, like opening another window or saving a form. If he chooses "cancel", it should stay in the same page (which is working now). pls share some idea on how to approach this issue</p>

<p><a href="http://jsfiddle.net/sk5yc/13/" rel="nofollow">Sample Code</a></p>
