Quote Originally Posted by welles
Actually, that was what I thought before. But I tested onBeforeUnload on FixFox and it works.
That is because Firefox is an open-source multibrowser compatible internet browser. I know it is rare but Netscape (unfortunately) still exists.

And I assume you want the leave to be cancelled if he/she clicks the "Cancel" button on the confirm. This would show that he/she wants to save the unsaved data.