 |
 |
 |
| Using TARGET With Frames |  |
|
|
The TARGET attribute of frames allows you to either specify in which frame a linked page is to be displayed in, or allows you to have a linked page display in the browser all by itself (not in a frame).
When a framed page is first defined, you can NAME each FRAME on the page, thus giving it a TARGET to load linked pages in. For example, here's some partial code for a simple two frame page:
| <FRAMESET COLS="170,*">
<FRAME SRC="navbar2.htm" NAME="navbar">
<FRAME SRC="intro.htm" NAME="main_frame">
</FRAMESET> |
When accessed, this will load a page called "navbar2.htm" into the left frame, which is NAMEd "navbar", and a page
called "intro.htm" will be loaded into the right frame (NAMEd "main_frame"). If you have links in the page "navbar2.htm" (the left frame) that you would like to have displayed in the right frame ("main_frame"), you'd add the TARGET attribute to the A HREF tag like this:
| <A HREF="mypage.htm" TARGET="main_frame">go here</A> |
In addition, there are four special TARGET names that you can use to provide control of where a linked page is to be
displayed. They are: "_top", "_blank", "_self", and "_parent".
If you use:
| <A HREF="mypage.htm" TARGET="_top">go here</A> |
Then "mypage.htm" will be loaded all by itself into the full body of the browser window without any frames.
If you use:
| <A HREF="mypage.htm" TARGET="_blank">go here</A> |
Then "mypage.htm" will be loaded all by itself into a new, separate browser window (this only works with Netscape and IE).
If you use:
| <A HREF="mypage.htm" TARGET="_self">go here</A> |
Then "mypage.htm" will be loaded into the same frame (the left one) that contained the link. This is the default, and it's not necessary to specify it.
If you use:
| <A HREF="mypage.htm" TARGET="_parent">go here</A> |
Then "mypage.htm" will be loaded into the immediate parent of the document that contained the link.
|
 |