iframe help - change two iframes with one click

A

Arne Hendrickson

Can anyone tell me how to edit this script for "traditional frames" to work
with iframes?

SCRIPT language="JavaScript">
<!----hide
function change2()
{
parent.left_frame.location="page3.htm";
parent.right_frame.location="page4.htm";
}
//------>
</SCRIPT>
 
E

Evgeny

Arne Hendrickson said:
Can anyone tell me how to edit this script for "traditional frames" to work
with iframes?

SCRIPT language="JavaScript">
<!----hide
function change2()
{
parent.left_frame.location="page3.htm";
parent.right_frame.location="page4.htm";
}
//------>
</SCRIPT>

call iframes by ID.

<iframe id="left_frame" ...><iframe>
<iframe id="right_frame" ...><iframe>

SCRIPT language="JavaScript">
<!----hide
function change2()
{
left_frame.location="page3.htm";
right_frame.location="page4.htm";
}
//------>
</SCRIPT>
 
A

Arne Hendrickson

I had already tried that but using the name attribute:

<iframe name="main" src="main.htm" height="430" align="left" width="610">

I tried adding the id attribute:

<iframe name="main" id="main" src="main.htm" height="430" align="left"
width="610">

as in your example but it didn't seem to help, then I tried one or the other
and both. Are the name and id attributes interchangeable? Is the problem
using both? Also my link is in an image map, but I tried it from a text link
as well which didn't seem to make a difference.
 
E

Evgeny

try this:

<SCRIPT>
function change2()
{
left_frame.src="page3.htm";
right_frame.src="page4.htm";
}
</SCRIPT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top