Thursday, February 9, 2012

  
  Host Gator    DT Templates Program    Tatoo    Network Solutions    Web.com:     Tatoo 2    Yola

Should I Use a New Window or the Same Window for Opening an External Link?

December 23, 2009 by  
Filed under Web Design

For as long as I can remember, there has been a controversy over whether clicking an offsite link should cause a new window to open, or whether the same window should be used for the new website. But on closer analysis, there really is not a controversy.

The \”controversy\”:

Most proponents of using a new window are website owners, while those favoring use of the same window are web-standards supporters, often the web designers themselves.

Why do website owners want to use a new window? They\’re afraid of losing their viewers. If the link uses the same window, then the viewer is no longer on the owner\’s site. In actual fact, I know of no study that has been done to show the percentage of users who don\’t come back, but site owners are hard to convince when they feel their livelihood may be at stake.

Proponents of using the same window point out that strict web standards do not allow the use of the target attribute, since this has now been deprecated by the W3C, the consortium that sets the rules.

In addition to this argument, the web designer usually points out that the viewer has two ways of dealing with an off-site link. He can choose to just click it, with the idea of using his BACK button to return to the original website. Or he can right-click the link and choose \”Open in a New Window\”.

Why there should NOT be a \”controversy\”:

To the best of my understanding, the reason for the W3C ban on the target attribute is that HTML – the language they are being \”strict\” about – is supposed to contain only information about WHAT is to be shown in the window of the browser. It is not supposed to concern itself with HOW or WHERE it is shown.

CSS dictates HOW web page information is shown. And everything else is done through the DOM. Therefore, what happens when a link is clicked is rightly the province of scripting.

Consequently, there is no real controversy. Web designers have the choice of opening off-site links in a new window through the use of javascript. Web standards will be upheld, and the page will validate as strict HTML. If you would like to see how to open a link using either method, just look at the paragraph below.

Visit the Professor\’s website, Professor\’s Coding Corner for useful code snippets and tutorials on various facets concerning web programming. In particular, there is some simple open new window code that will satisty strict web standards. Grab a totally unique version of this article from the Uber Article Directory

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

*