irt.org FAQ Knowledge Base Q1578
Corvus on June 21, 2001 at 17:37:40:
Not technical enough
While OnBeforeUnload and OnUnload will fire if you close the window, it will also fire if you click a link, open a bookmark, refresh the page, go forward or backward, submit a form..., in fact, when you do just about anything on the page.
If you want to do something *only* when you leave a page this will not help