onbeforeonload call on iframe window

M

Madhumita

Hi,
I cannot get the onbeforeonload call on a iframe window to fire when I
change the src of the iframe. Any clues on this will be appreciated:

So if I have an iframe called myIframe and set a onbefore handler and
change the location, I don't see it being triggered.

myIframe = createIframe();
myIframe.contentWindow.onbeforeunload = fr_unload;

myIframe.contentWindow.location = url1;
myIframe.contentWindow.location = url2;

When I am changing the location I don't see the alert statement that I
have in the function fr_unload being triggered.

I tried testing this on both IE (6.0) and Firefox (2.0).

Any ideas on this?

Thanks,
Madhumita
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top