Uses of the New Window Command for Web Sites - Approaches to opening a link in a new window
(Page 2 of 5 )
Before I show the approaches, I'd like to review some basic HTML knowledge about the window name, because every window in the browser has its own name. The default name is an empty string "", so we can say the window has no name. There are four special window names: "_blank", "_self", "_parent" and "_top". By using "_blank" you indicate that the link will be opened in a new blank window, while "_self" indicates that the window will open in the same window. The third option, "_parent," means the link will be opened in the parent frame. This name is usually used in frameset pages. The last one, "_top," indicates the top level window, which is used in some pages with the <iframe> tag to include other pages inside the <iframe> content, where links can open in the top level window.
1. Set target attribute of the link
e.g.
<a href="http://www.google.com" target="_blank">Go to Google.com</a>
When visitors click the link above, a new window will open and display the content of the Google search engine page.
Caution:
The target attribute is deprecated in the latest strict version of HTML (XHTML), so it is not recommended that you use it this way. If your web sites use this approach, the pages will not pass XHTML validation (http://validator.w3.org/), which means the web page is not a standards-strict XHTML page. Luckily this attribute can still be used in the XHTML transitional and framesets mode.
2. Right mouse contextual menu
I think this approach is the most commonly used one when you want to have a link opened in a new window. The original design of the web page does not behave that way, but we can move our mouse over the link and right click the mouse in order to pop up the contextual menu. There is an item called ''Open Link in New Window." The following pictures show this when we right click the mouse on Google's home page.

Picture 2 - Right mouse contextual menu in Firefox

Picture 3 - Right mouse contextual menu in Internet Explorer
Next: BASE tag >>
More HTML Articles
More By Stephen Davies