New Window or Old Window – Which Should be Used for an External Link?
There has long been a controversy between those who think that all links leading offsite should open in a new window, and those who think they should open in the same window. I maintain that this is not a real controversy.
The apparent “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 any case, it is easy enough for the viewer to come back to the original website. He can right-click the link and select “Open in a New Window”, thereby saving the old window to return to later. Or he can just use the same window, but return to the originating website by using his BACK button.
Here’s why there really isn’t any “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 author’s website, Professor’s Coding Corner for some useful code snippets and tutorials on interesting aspects of web programming. In particular, there is some simple open new window code that will satisty strict web standards.