Changing Text in another frame

They have: 16 posts

Joined: Mar 2001

My webpage is divided into three frames. The first frame displays my menu, the second frame contains my banner ads and the text heading that identifies what page the user is currently viewing and the third frame (dynamic) displays the information about the link.

What I want to happen is that everytime a new page is loaded on the third frame, the text displayed on the second frame changes depending on the chosen link. How am I going to do this?

I tried using images instead of text to change the heading of the page on the second frame --> using this code: parent.TopBanner.BannerText.src = "Welcome.gif"
But unfortunately, it does not work in Netscape and unpredictably causes a runtime error in IE.

I prefer to display the heading using text instead of an image to speed up download time. Help!

They have: 383 posts

Joined: Sep 2000

This can be done with JavaScript. If your using DreamWeaver the "Go To URL" behavior works perfectly. There are also tons of scripts around the net.

Add to the HEAD of your document

<script LANGUAGE="JavaScript">

<!--

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

//-->

&lt;/script&gt;
'

Link Example – Loading two separate documents in two different frames with one click.

<A HREF="whatever.htm" TARGET="frame_name" onClick="MM_goToURL('parent.frames[\'frame_name\']',’whatever.htm ');MM_goToURL('parent.frames[\'other_frame\']','whatever2.htm');return document.MM_returnValue">LINK</A>
'

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.