I\'d like to check if the current browser supports the onbeforeunload event. The common javascript way to do this does not seem to work:
if (window.onbeforeu
It would probably be better to just find out by hand which browsers support it and then have your conditional more like:
if( $.browser.msie ) {
alert( 'no' );
}
...etc.
The $.browser.msie
is jQuery syntax, most frameworks have similar built-in functions since they use them so much internally. If you aren't using a framework then I'd suggest just taking a look at jQuery's implementation of those functions.