frames and onUnload event not executing


D

Derek

Hi All,

I have an index.html file which sets up a frameset. On one of these frames I
need an event that will trigger whenever the page is refreshed or changed
for a certain page. Example:

<frameset ...
....
<frame src='somePage.html' ... >
....
</frameset>

And for the <BODY> declaration of "certainPage.html" I've got:
<BODY onUnload='javascript:myFunction();'>


The problem is when I load "certainPage.html" on it's own the onUnload
trigger will fire correctly whenever the page is refreshed or it's location
changed. However when I open up the "index.html" page with the frameset the
onUnload event for "certainPage.html" won't fire. The interesting thing is
that all onLoad events will fire properly but onUnload doesn't.

Can anyone explain this to me?


I've also thought about having an onUnload event for the frame itself (which
would detect if the location.href = "certainPage.html") but I can't get that
event to fire either.


What's the easiest way to fire off some javascript for a page within a frame
whenever it's content is changed?


Any help / pointers / references appreciated.

Cheers,
Derek
 
Ad

Advertisements


Top