Question:
Can you detect onload event of one frame from another frame multiple times in html and javascript code?
mred_11
2008-02-06 23:14:10 UTC
I have an html page that uses frames. I want to detect onload event of one frame (call it frame A) from another frame (call it frame B). Frame A is frequently loaded with new html pages. Frame B is only loaded once with the onload event code. The idea is to have frame B detect each time frame A is loaded. I tried loading frame B first, then frame A. Frame B was able to detect the first time frame A loaded, but not any subsequent loads. It seems the onload event only works one time. Only if I reload frame B, can the onload event work again, but again only one time. This defeats my purpose of keeping frame B static while detecting frame A's dynamic activity. Any ideas? Is multiple detection of the onload event even possible with html and javascript?
Three answers:
richarduie
2008-02-07 09:27:39 UTC
The easiest approach is to have the second frame notify the first. I don't know how you manage your reload operations. Thus, I simply set this up to allow you manually to reload the second frame to demo purposes. When the second frame is reloaded, it will notify the first frame.



frameset.html

~~~~~~~~~~~~~





















frameA.html

~~~~~~~~~~~











content for frame A goes here







frameB.html

~~~~~~~~~~~











content for frame B goes here



2016-12-10 20:39:49 UTC
Frame Onload
Margaret
2015-04-28 22:26:30 UTC
sophisticated task. do a search onto google and yahoo. that can help!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...