Targeting individual frames when loading a new frames page

liunx

Guest
I am trying to have a link that will replace the current page with a frames page. That is easy, the complicated part is that the frames page has 2 frames, say frame1 and frame2. Frame1 is going to be static, but i want to target frame2 with a different page depending on the link clicked on the original page. The original page does not have frames. Any help would be greatly appreciated,<br />
<br />
Thanks a lot.<!--content-->Well if I'm reading your post correctly it's not going to be that hard.<br />
<br />
Just Target your links to what the frame you want to change is named.<br />
<br />
Your browser will look to see if there is a window or frame with that name and if it finds it will open in that frame. If it does't find it;ll open a new window.<!--content-->hmmm let me try to explain it a little better,<br />
<br />
I have a page that has no frames with a link that will load a page with two frames. One of the frames on the new page, named "contents", needs to load different pages depending on the original link. Basically i want the original link to do two things, switch the page to a new frames page, and in one of the frames on that page load a certain page.<br />
<br />
Thanks for the help!<!--content-->You could try something like this:<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"frameset.html?somepage.html">Click Me</a><br />
<br />
And then in your frame set:<br />
<html><br />
<head><br />
<title>Frame Print Demo</title><br />
<script language="JavaScript"><br />
function frame_saver()<br />
{<br />
if (self.location.search)<br />
{<br />
parent.frameb.location = location.search.substring(1,location.search.length);<br />
}<br />
}<br />
window.onload = frame_saver;<br />
</script><br />
</head><br />
<frameset rows="25%,*" border="1"><br />
<frame src=http://www.webdeveloper.com/forum/archive/index.php/"looka.html" name="framea"><br />
<frame src=http://www.webdeveloper.com/forum/archive/index.php/"lookb.html" name="frameb"><br />
</frameset><br />
<br />
The initial page in "frameb" could be a default page in case some one comes to the framed page without clicking on the link. When they click on the link the part after the question mark is passed throught the URL to the frame set. The script in the frame set extracts that part and loads "frameb" with the document.<!--content-->Thanks for the help, i think i have it almost working, i implemented your code, but i keep getting one error:<br />
<br />
'parent.frameb' is null or not an object. any ideas?<br />
<br />
thanks a lot for the help guys<!--content-->ok nevermind i got it working, thanks lot guys for your help<!--content-->
 
Back
Top