Setting a link’s target window or frame
Normally, when you click a link in a browser, the destination of that link (if it is something that can be displayed in a browser) opens in the same window or frameA window partition. When a browser window is partitioned, each partition, called a “frame”, can display a different document. The set of all frames is called a frameset. that displayed the document containing the link, replacing the original document. However, you can make the destination of a link open in a different window or frame from the one displaying the current document. You do this by specifying the link’s target.
For example, if you set a link’s target to “frame2″, the browser will try to open the link’s destination in the frame named “frame2″. If there is no frame by that name, the browser will then try to open the link in the window named “frame2″. If there is no window by that name, then the browser will open the link in a new window and name the window “frame2″.
A link’s target can be the name of a window, the name of a frame, or one of these special keywords:
- _blank: The link will be opened in a new, unnamed window.
- _parent: The link will be opened in the current frame’s “parent”, replacing the current frameset. The parent is usually the browser window, but if the current frameset is being displayed inside one frame of another frameset, then the parent is the containing frame in the higher-level frameset.
- _self: The link will be opened in the current frame or window.
- _top: The link will be opened in the current window. If the window is divided into frames, the link’s destination will replace the frames.
A window’s name is not the same as its title, the words that appear in its title bar. If a window has a name, it is not visible to users, but the browser remembers it as long as the window is open. To create a browser window with a certain name, set the target of a hyperlink to the desired name. If you want the named window to be initially empty, set the link’s URL to “about:blank”.
In general, there is no reason to set the target of a single hyperlink to a named window. However, if you have several hyperlinks that you would like to open in a separate window from the current document, but you don’t want a new window to be opened for each link, you can set all of the links’ targets to one window name. When the first link in the group is clicked, the browser will create a new window and open the link in it. Then, when other links in the group are clicked, they will open in the same window.
To set a link’s target
- Double-click the link to open the Hyperlink Properties dialog box.
- In the Target box, type the desired frame or window name, or click the triangle and select one of the keywords or frame names (if a frameset is open). If a frameset is currently open, you can also click (Select Target Frame) to select a frame visually.
You can also set a link’s target using the Target box on the Hyperlink Toolbar. Type a window or frame name in the box or click the triangle and select one of the keywords or frame names.
Related topics
Setting a default target for hyperlinks
Setting a frame’s default target
Making a link open in a pop-up window