Forum Moderators: open
Try this, I believe it will do the trick:
function twoFrameChange(nav,content){
top.iframe1.location.href = nav;
top.iframe2.location.href = content;
}
<a href="javascript:twoFrameChange('nav.htm','content.htm');">link1</a>
<edit>fixed script</edit>
[edited by: korkus2000 at 7:42 pm (utc) on Sep. 15, 2003]
<a href="javascript:twoFrameChange('nav.htm','content.htm');">
you need to change the frame names to the names of your frames here:
top.iframe1.location.href = nav;
top.iframe2.location.href = content;
The javascript function should go inside the head tag inside a script tag.
What is happening when you run it eleven? Works in Opera and IE here.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>two frame test</title>
<script>
function twoFrameChange(nav,content){
top.iframe1.location.href = nav;
top.iframe2.location.href = content;
}
</script>
</head>
<body>
<iframe name="iframe1" src="http://www.yahoo.com"></iframe>
<iframe name="iframe2" src="http://www.google.com"></iframe>
<br>
<br>
<a href="javascript:twoFrameChange('http://www.msn.com','http://www.alltheweb.com');">link1</a>
</body>
</html>
The main reason I wanted the targetting to go to two iframes is that I ran into a design flaw with my site in that the first frame has navigational links in it EXCEPT the homepages iframe. DOH! Now, with both the nav and content frame showing material, I can put updates on the content frames html page and keep the homepage "banner" in the nav iframe the same.
Life is good...