Tutorial 14: You've been Framed, Part I - HTML with Style | 7 | WebReference

Tutorial 14: You've been Framed, Part I - HTML with Style | 7

index1234567exercises1

Tutorial 14: You've been Framed, Part I

Using TARGET to create new browser windows

As an aside, I should note that TARGET can also be used to load the destination document of a hyperlink into a new browser window. By giving the TARGET attribute a value that is not an existing frame, you indicate that the browser should create a new window, and display the document in that window. If another link is followed that has the same TARGET value, it will be loaded in this window. This technique can be used to create Web pages that work across multiple windows. However, this technique is discouraged since (a) it depends on the user agent running on a graphical window system and (b) it takes control of the browser away from the user. All browsers have the option of viewing a document in a separate window, and it's best not to invade your user's workspace and allow him to choose when to open a new window. The technique is shown below:

<P>You can open <A HREF="http://www.webreference.com/html/"
TARGET="awindow">this link</A> in a new window, and any <A
HREF="http://www.webreference.com/html/watch/" 
TARGET="awindow">other links</A> that have the same 
target will be displayed in this window. You can 
open this window by clicking on either of the links 
above, but 
<A HREF="http://www.webreference.com/html/tutorials/">normal 
links</A>
will be displayed in the current window. <A
HREF="http://www.webreference.com/html/tools/"
TARGET="anotherwindow">Links with different targets</A> will be
displayed in a different window.</P>

You can open this link in a new window, and any other links that have the same target will be displayed in this window. You can open this window by clicking on either of the links above, but normal links will be displayed in the current window. Links with different targets will be displayed in a different window.

index1234567exercises1

URL: http://www.webreference.com/html/tutorial14/6.html

Produced by Stephanos Piperoglou
Created: June 30, 1999
Revised: June 30, 1999