Busted Mug

A blog that documents solutions to the most frustrating problems that occur during development in technologies such as Java, XML, AJAX, SQL, CSS and others that make me want to throw my coffee mug against the cube wall.

Wednesday, January 10, 2007

OnBeforeUnload Event WORKS IN FIREFOX, TOO!!!

A page on the MSDN is erroneously spreading the notion that onBeforeUnload is supported only by IE.

onbeforeunload Event (BODY, FRAMESET, window)

That is totally false. FireFox has supported onBeforeUnload since version 1.7. The reason there is beef about this event is that it is not a part of either the W3C spec or the ECMA spec. However, it has taken on wide support because it provides necessary functionality. It is used mainly to keep a user from navigating away from a page where they have unsaved input (more for web apps than pages).

So by all means use onBeforeUnload if you need that kind of functionality as it is likely to be adopted into some standard due to it's far reaching use (even Google does it). Just be sure that you script something for onUnload for the Opera users.


Post a Comment

<< Home