Forum Moderators: open
I have a page with say two iframes...
<html>
<head>Problem</head>
<body>
<a href=newpage.htm target=_contents>Newpage</a>
<h1>Iframe1</h1>
<iframe src=banner.asp>
<h1>Iframe2</h2>
<iframe src=content.asp target=_contents>
</body>
</html>
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
First
When you set up each iframe, give it a name - let's use "banner" and "content".
Next
Define the following function in the HEAD or external js file:
function loadFrames(page1,page2) {
eval("window.frames.banner.location='"+page1+"'");
eval("window.frames.content.location='"+page2+"'");
}
Finally
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>
etc.