View Full Version : target="_blank"


dcolin
01-21-2007, 11:21 AM
If i use target="_blank" so that i or even any visitors to my webpage can return to the original page i can't get the webpage validated. Does anyone know of a way around this problem by using CSS or even JavaScript? Thanks DC

J to the izzosh
01-21-2007, 11:53 AM
The target attribute - now deprecated - was used to target links to specific windows or frames and can't really be called a way to have people "return to the original page". Opening links into new windows, especially without informing the user that it will happen, is generally discouraged (http://diveintoaccessibility.org/day_16_not_opening_new_windows.html) because it isn't very conducive to using the back button, which is the the most used navigation feature of the internet. There is a nice script, however, which allows you to open links in new windows based upon a specific attribute/value combination. For example, you could use a certain class and style that class with CSS in a way that demonstrates it will open in a new window. It is Roger Johansson's Opening new windows with JavaScript, version 1.2 (http://www.456bereastreet.com/archive/200610/opening_new_windows_with_javascript_version_12/).

Also, a side note: you seem to have a slight misunderstanding of CSS. It would not have been able to do something like this. CSS does not produce content (very well) or behaviour; it is merely for style. Thus, "Cascading Style Sheets".