onbeforeunload in an iframe

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have an iframe in which I load a page. This page may be replaced,
later, by a second page. When this happens, the first page would like to
do some tidy up - so when first loaded, the first page registers an
onbeforeunload handler.

Problem is that the onbeforeunload event of the first page doesn't seem
to fire when the second page is loaded. This is in Safari 6.0 Mac. Is
there anything about the above scenario which would prevent this event
from firing?


"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

Site Timeline