Is there a way to capture to result of the window.onbeforeunload confirmation dialog like the one below from Stack Overflow (this happens when leaving the \'Ask Question\' p
How about this:
$( window ).bind( 'beforeunload' , function( event ) { setTimeout( function() { alert( 'Hi againe!' ); } ); return ''; } ).bind( 'unload', function( event ) { alert( 'Goodby!' ); } );