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!

How to specify target frame on another page

Status
Not open for further replies.

stressball

Programmer
Mar 14, 2001
68
AU
Hi,

I have 2 pages. The first page has a link to the second page, which is fine, but when the user clicks on the link I need the second page to open with a .htm also loading in the main frame of the second page.

Your help would be greatly appreciated.
 
<a href=url target=framename>link to open url in framename</a>
 
iza

Thanks for your reply, I would like to get this working using just HTML, but what you said does not work.
When the user clicks on the button on the first page I need the second frameset.htm to open, when that frameset opens, I need index.htm to be visible in the main frame.

<a href=&quot;pages/page_frameset.htm&quot; -(the frame set to load)
target=&quot;pages/test.htm#mainFrame&quot; -(the page to load in main)
</a>

This does not work, it displays the frameset, but main is empty.

Your help would be most appreciated :)
 
pages/test.htm#mainFrame is NOT a frame name !!!

say you have this in mymainframeset.htm
<frameset ...>
<frame name=main src=new_url.htm>
<frame name=top src=url.htm ...>
</framset>

now you're in url.htm (in the frame named &quot;top&quot;), and you want to change the CONTENT of the frame named &quot;main&quot;, right ?
simply do <a href=&quot;new_url2.htm&quot; target=&quot;main&quot;>link</a>

now you're somewhere else, framed or non framed, and you want the frameset to appear with new_url.htm inside main, right ?
just call <a href=mymainframeset.htm>link</a>

sounds like you need to reread the doc anyway !!!
 
what is the difference between the &quot;_top&quot; and &quot;_parent&quot; for the target attribute of the Anchor tag? They seem to be doing the same of opening the link in the whole window. Using Javascript &quot;parent.&quot; you can target the individual frames but how is this done using _parent in html

e.g <a href=&quot; target=&quot;_parent&quot;>link</a>

When I read the explanation for &quot;_parent&quot;, the books say that when used with frames it opens up the document in the parent window or parent frame of the current frame.... but no matter which child-frame i use this attribute the page opens in the whole window...

Would appreciate some help with examples.

Thank you
 
Thanks for your help, but I don't think you understand what I'm trying to do, I've solved it by using separate framesets for my separate purposes for this web site.
 
mj : top is the TOPMOST frame, whereas parent is jsut the upper one
see here

<frameset ... name = 2>
<frame ...>


<frameset ...name = 1>
<frame ...>
<frame ...>
</frameset>


</framest>


if i'm in one of the 'blue' frames, parent is the blue frameset (name=1), whereas top is the RED one (name=2)
now if i'm in the red frame, parent AND top are the same frameset (name=2) - so yes it's the same if you only have 1 level or are at the topmost level
----

stressball : yes that was the second solution i suggested in my previous post - as it was unclear if you were in a framed part or not
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top