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

Working with frames

Status
Not open for further replies.

cyberprof

Programmer
Jun 10, 2003
229
GB
I'm using a frame set (banner and contents). The top frame is called 'top', the left hand frame is called 'menu' and the largest frame is called 'main'

If a hyperlink in 'top' is clicked, can I load up different pages in 'menu' and 'main' at the same time.

Cheers

J
 
you need to use javascript. try this (I haven't tested but it should work).
on your link use
Code:
href="#" onClick="javascript: loadLink('pageReferredForMain.htm', 'pageReferredForMenu.htm')"
and in the head section use
Code:
<script language='JavaScript'>
function loadLink(mainPage, menuPage)
{
     parent.forms["main"].document.location = mainPage;
     parent.forms["menu"].document.location = menuPage;
}
</script>
 
If Dazzled suggestion does not get the expected results, then try the identical but slightly different syntax

Code:
parent.parent.[framename].location='[newpage.html]'"

Notice that the brackets are not part of the command string but simply to denote what you need to change according to your needs.

That said, you command may endup looking like this should you choose to use an onClick event:

Code:
onClick="parent.parent.top.location='[newtoppage.html];parent.parent.menu.location='[newmenupage.html]'"

Again, change brackets and enclosed string with actual page name.

Hope this helps!


Jose


KNOWLEDGE: Something you can give away endlessly and gain more of it in the process! - Jose Lerebours
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top