Linking to a specific frame?

Joined
Dec 13, 2004
Messages
820
Hi, I hope to borrow some wisdom from you folks. I need to know how to link to a page and have a specific frame displayed in the main frame. Is there a way to do this? Right now my link will only open the main page and it loads the default main page frame, which is not what I want. The page to be linked to has an inverted L frame for banner and nav, and a main frame for data.

Any help would be appreciated!
 
Is the target attribute what you are after?

i.e.:
Code:
<a href="somewhere" target="name">some link</a>

where name is either:
  • _parent
  • _self
  • _top
  • _blank
  • or the frame name
 
Sort of, I have the target="_top" in my link. But it always loads the default frame, I want to be able to load the page on top, but with different frames in main.

Like this:

http://www.highroadproperties.com

the splash page loads, and if you click "find a realtor" it loads the main realty site with the "find a realtor" frame displayed. But it you click the "Search Homes" link from the splash page, the main page loads with the "Find a Realtor" frame loaded. I want it to load the main page and change the main frame to whatever was requested from the splash page. I'm thinking Javascript, which I'm rusty on.
 
I think I know what you mean now. You can do that with HTML. I personally find frames messy as I think you are discovering. Wherever possible I would use <div> tags to split up information.

Anyway, the HTML way:

Set the link target to "_top" to effectively load it in the entire window. Link to a page that contains the frameset. I.e.:

index2.html
Code:
<html>

<frameset cols="30&#37;,70%">

  <frame src="frame_d.htm"> <!-- This could be a menu frame -->
  <frame src="frame_e.htm"> <!-- while this could be the content page -->

</frameset>

</html>

To load this layout from a link use:
Code:
<a href="index2.htm" target="_top">Click Here</a>

...you could set an existing frame to show two new frames:
Code:
<a href="index2.htm" target="someOtherFrame">Click Here</a>

Does this answer you're question?

W3Schools has some great tutorials on this kind of thing.
 
Yes, that's it! Thanks you very much. Frames aren't my first choice, but it's what they wanted.

Thanks again.
 
Back
Top