Lately I've been in a heated debate with colleagues at work on why they shouldn't use the target attribute anymore and how they should and could work around this "problem". Ever since there was a Strict doctype the target attribute was deprecated (yes, also in HTML 4.01 Strict!). Personally I've never wanted to use this attribute because you remove the ability of the end-user of a webapp or the visitor to your own website to choose how he or she wants to open a (new) window. Therefore I've always opted to let my more than able visitors to choose for themselves. If they want to return there's always the back-button or the history in the browser. Or they just use Ctrl + mouseclick to open a new window (or a tab)themselves. But for some time now there's an unobtrusive script around that can help those who don't know how to or who have to open links in a new window.
Roger Johansson at 456Bereastreet has developed a piece of magic Javascript that gives everyone the possibility to have links that open in a new window AND have a page that validates. There are other solutions around as well, but I kinda like this one due to its simplicity and its adherence to standards. So if you ever wanted to know how to or if you have to, get the script here!
Updated 09 May 2006, by Sebastiaan Naafs - van Dijk
Roger Johansson has posted an update on his script that's really an improvement. Read the full post here.
Updated 24 October 2006, by Sebastiaan Naafs - van Dijk
After some some months every good thing must get an update. So also the fabulous javascript of Roger Johansson "opening new windows with javascript (version 1.2)".
Posted by Sebastiaan Naafs - van Dijk | top
posted:
1... on 08 December 2024 @ 13:56