target frame

windows

Guest
okay, i have two frames, lets say left.html and right.html, in my frameset. the frame names are "left" and "right". on right.html, i have a link, which should open in the same frame, but i also want it to target the left frame to open a page with an image at the same time. how do i target two frames with one link? do i need javascript? if so, whats the code? thanks.<br />
<br />
jared<!--content-->and plus, i have about 3 other links i want to do the same thing with on that page. so would i need to repeat the code? thanks whoever helps.<br />
<br />
jared<!--content-->http://www.snippetlibrary.com/code.php?id=5&kid=21&catname=Frames<br />
<br />
and yes you will.<!--content-->im having trouble understanding this code. its not functioning so im wondering what i have to change for it to relate to my own pages. im guessing location = is where i put the pages i want to open... but where it states "right_frame" do i leave it like that or change it to the name i have for the frame? i've tried many different things and i cant get anything working. some additional help would be appreciated. thanks.<!--content-->you cahnge teh right_frame to what frame you want the page to load.<br />
<br />
can you show us what you have so far.<!--content-->could use a reuseable javasfipt...<br />
<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<br />
<html><br />
<head><br />
<title>Untitled</title><br />
<script language=javascript><br />
function linkIt(leftContent, rightContent){<br />
whatFrame="parent.frames."+leftFrame;<br />
parent.frames[0].location=leftContent;<br />
parent.frames[1].location=rightContent;<br />
<br />
<br />
}<br />
</script><br />
</head><br />
<br />
<body><br />
<a href=http://www.htmlforums.com/archive/index.php/"#" onClick="javascript: linkIt('http://www.yahoo.com/', 'http://www.eye4u.com/');">Dual open...</a><br />
<br />
<br />
</body><br />
</html><br />
<br />
<br />
Parent.frames[0] is the FIRST frame on your page (javascript starts with a zero instead of a one.)<br />
<br />
Parent.frames[1] is the SECOND frame on your page. <br />
<br />
Pay attention to the a href line, as you call things a little different. Good luck!<!--content-->i did exactly as you said, dr. web. link still sitn functioning, and at the bottom of the explorer browser, it said "done, but with errors on page". i checked the details and it said:<br />
line: 37 (thats the a href)<br />
char: 6<br />
expected: ';'<br />
<br />
i am losing my mind. i usually can just figure this stuff out. why does god hate me?<!--content-->usually the forus put a space in between java and script. Its all one word, but will cause errors if you leave it as java script.<!--content-->
 
Back
Top