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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change the content of 2 frames simultaneously?

Status
Not open for further replies.

CuRtana82

Programmer
May 22, 2001
17
0
0
AU
Hi, I have a link and I was wondering if I can make it change the content of two seperate frames at the same time

Thanks
 
If the following were loaded in "frame_top", then upon loading, it will call loadBottom(). I think there's probably a better way than this, but this should do in a pinch.


<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--
function loadBottom() {
parent.frames[1].location=&quot;bottom.html&quot;;target=&quot;framebottom&quot;
}
// -->
</SCRIPT>

</head>

<body bgcolor=&quot;#FFFFFF&quot; onLoad=&quot;loadBottom()&quot;>
John Hoarty
jhoarty@quickestore.com
 
Assuming you are loading a page called nav_page.html into a frame called nav_frame, and a page called content_page.html into a frame called content_frame, this would work also.


<head>
<script language=&quot;JavaScript&quot;>
function load_two(URL1, URL2)
{
parent.nav_frame.location=URL1;
parent.content_frame.location=URL2;
}
</script>
</head>

<body>
<a href=&quot;javascript:load_two(&quot;nav_page.html&quot;,&quot;content_page.html&quot;)>LINK</a>
</body>
</html>
 
Thanx JHoarty, I used the code, but i have a small problem in that the target doesnt seem to be working. I have 14 frames on the page all named 1-14 but the second html page only opens in the second frame no matter what.
 
I just changed the target to blank and a whole heap of others but it is still opening the html document in the same frame as before
 
Sweet Mother! 14 frames?! I hope you have a good memory for what goes where! Is this site live on the net where we can look at it? Personally, I'd suggest you use DoubleHelix's code example, its a little more customizable.
 
Hi,

Maybe this is what you're looking for?

faq215-733

Hope this helps,
Erik
 
Sorry to inform you that the site has been re-designed, it now only contains 12 frames. Using them to split up images and such, similar to


thanx fo the help
 
Also is there anyway I can preload the images used in the frames in the default frameset? ie I wnat image1.gif and image2.gif to preload in default.gif
 
Using a scripting language you could precache images in the head of the page that called the frameset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top