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

Javascript and embedded frames

Status
Not open for further replies.

Elminstyr

Technical User
Oct 9, 2010
1
0
0
US
Ok, I have a page consisting of a header frame, left and right frame. In the left frame are images. I want to click an image and have text appear in the right frame. Here is what I have for the frames. I'm using an external java file containing the function I need, which I had working with no frames, but I wanted to make the page look better. I can't figure out how to access the embedded frame "container". I've tried things like:
window.frames['container'].document.getElementById(id), but I cant get it to work.

<frameset rows="200,*" border="0">
<frame name="header" src="header.html" marginwidth="0" marginheight="0" frameborder="0" scrolling="no">
<frameset cols="250,*" border="0">
<frame name="links" src="leftframe.html" marginwidth="2" marginheight="0" scrolling="no" frameborder="0"/>
<frame name="container" src="container.html" marginwidth="0" marginheight="0" scrolling="no"frameborder="0"/>
</frameset>
</frameset>
 
>I've tried things like:
window.frames['container'].document.getElementById(id), but I cant get it to work.

Do this instead:
[tt] var refdiv=[red]top[/red].frames['container'].document.getElementById(id)[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top