HighDots Forums  

frames and onUnload event not executing

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss frames and onUnload event not executing in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Derek
 
Posts: n/a

Default frames and onUnload event not executing - 02-23-2005 , 12:51 AM






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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.