HTML
  Home arrow HTML arrow Page 2 - Uses of the New Window Command for Web Sit...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Uses of the New Window Command for Web Sites
By: Stephen Davies
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2008-02-26

    Table of Contents:
  • Uses of the New Window Command for Web Sites
  • Approaches to opening a link in a new window
  • BASE tag
  • Examples of common new window uses
  • Advanced Usage

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    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


    More HTML Articles
    More By Stephen Davies


       · open new windows is in most cases - from the user's point of view - a bad idea:*...
     

    HTML ARTICLES

    - Using a 3D HTML Table as a Recordset
    - Building a 3D HTML Table
    - Maximizing and Restoring HTML Images: Layer ...
    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT