Using links in frames

It is possible to load a page into any one of your frames, from anyone of your frames.
To do this you use the "Target=" attribute.

When creating a frameset each frames is given a name, this is the name that the target= attribute uses to identify the frame where the page is to be loaded.

EG.
The example frameset below shows a typical 3 frame layout
The header frame is typically called "header" therefore to load another page into the header frame the following code is used.

<A href="yourpage.htm" target="header">Your Link</a>

Select a link in the example frameset left

<A href="headpage.htm" target="header">Head Link</a>

<A href="navpage.htm" target="navbar">Nav Link</a>

<A href="mainpage.htm" target="main">main Link</a>

Depending on your layout you might have to use the underscore in the target attribute

EG:

<A href="mainpage.htm" target="_main">main Link</a>

Target Attributes

  • _blank
  • _self
  • _parent
  • _top
  • _your frame name
Load content into a new window
Load content into the calling frame
Load content into the parent frameset
Load content into the top frameset
Load content into the named frame

Creating a link to close a frameset

If you open a frameset in a new browser window it is possible to close that frameset, similar to closing a window, by using the following code:

<A HREF=JavaScript:window.top.close()>Close Frameset</A>