Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reload a frame from an onLoad in another frame

Status
Not open for further replies.

dpkdesign

Technical User
Feb 16, 2002
1
US
I have a frameset with a navigation bar at left, a banner frame on top right and content frame beneath the banner frame

I want the banner frame to reload when a new page is loaded into the content frame. I do not want the reload to come from the navigation bar.

Anyone have any suggestions?
 
I don't know why you would want to do something like that... Why not just have a <meta> tag to refresh the advertisement at intervals?

And if you want to use javascript, why not use the navbar to trigger the banner's frame to load? It would require a lot less maintainance than the alternative. (The alternative: having each and every content page have a script on it to load the banner)

If you want to use the navigation frame to trigger the banner frame to load, enter this into each clickable <a> tag:
Code:
onclick=&quot;parent.frames.banner.document.location.reload();&quot;
As long as all the frames are contained within one frameset and the banner frame is named &quot;banner&quot;. The above is assuming that your banner frame already is assigned a URL to a banner-generating script.


If you really want to use a script in each and every loaded frame, here's the code:
Code:
<script type=&quot;text/javascript&quot;>
<!--
parent.frames.banner.document.location.reload();
// -->
</script>
The above also assumes that your banner frame is named &quot;banner&quot; and that it is within the same frameset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top