The target attribute and opening new windows

Robert Nyman brings up an interesting discussion about opening new windows, specifically by using the target attribute, in How evil is the target attribute?.

The target attribute is not allowed in strict doctypes, and since you should always use a strict doctype, the target attribute is invalid. Period. Unless you use frames, which you should not.

Opening new windows is a nuisance and should be avoided. There are very few cases where a new window is acceptable. If I was forced to open a new window I would definitely use unobtrusive JavaScript instead of invalidating the markup by inserting a target attribute.

My reasoning is that validation is a very useful tool. By deliberately inserting erroneous markup you make that tool harder to use and thus less valuable. Harder to use? Yes, because each time you validate a document you will get validation errors that you need to filter out before you can tell if there are any other, "real" errors.

Most important though: If you, for whatever reason, decide to open a link in a new window, make your users aware of it and if possible give them a choice.

Posted on March 28, 2006 in Quicklinks, Accessibility, Usability