homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

IFRAMEs, JavaScript, ASP
Help wanted: How to reload 2 iframes with one click

10+ Year Member

Msg#: 78 posted 4:51 am on Apr 5, 2002 (gmt 0)

I have a problem with a new website I'm developing.

I have a page with say two iframes...

<a href=newpage.htm target=_contents>Newpage</a>

<iframe src=banner.asp>

<iframe src=content.asp target=_contents>


Now, I want to be able to click on a link in either the body or in _contents-iframe and then reload banner.asp while loading a new document for the iframe.

Hope you guys can help me out



WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 78 posted 6:24 am on Apr 5, 2002 (gmt 0)

Ondfisk, welcome to the boards! This is script I use to change 2 frames from one link. Never tried it with iFrames but I think it should work. Since each iFrame is contained as a window object in the window.frames, it should convert just fine.

When you set up each iframe, give it a name - let's use "banner" and "content".

Define the following function in the HEAD or external js file:

function loadFrames(page1,page2) {

Code the links into the main page:

<p><a href="javascript:loadFrames('banner1.asp','content1.asp')">Load Combo #1</a>

<p><a href="javascript:loadFrames('banner2.asp','content2.asp')">Load Combo #2</a>


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved