Sunday, October 28, 2007

456 Berea Street: Using JavaScript instead of target to open new windows

http://www.456bereastreet.com/archive/200605/using_javascript_instead_of_target_to_open_new_windows/
"In my recent post about The target attribute and opening new windows, I stated that when I am faced with no other choice but to open a link in a new window, I prefer using unobtrusive JavaScript instead of the target attribute. The reason is that I always use a strict doctype, which does not allow the target attribute.

What I did not say was exactly how the script I use is constructed, but I guess I should have. A few people commenting on the post thought that I was suggesting the use of JavaScript to insert the invalid target attribute simply to hide it from the W3C Markup Validator. Cheating to pass validation is not what I am proposing."

No comments: