yertle Posted April 20, 2010 Share Posted April 20, 2010 When validating XHMTL 1.0 Stirct Doctype, I get errors concerning the Target attribute.This code validates: <a href="http://www.w3schools.com/">Visit W3Schools!</a> Whereas this code does not validate: <a href="http://www.w3schools.com/"target="_blank">Visit W3Schools!</a> If in fact the Target attribute is not valid in XHTML 1.0 Strict doctypes, then how does one get a link to open in another window, instead of the parent window?Or, does this stem from problems arising due to links opening in new windows? If so, what problems are being avoided by disallowing links to open new tabs or windows? Link to comment Share on other sites More sharing options...
Err Posted April 20, 2010 Share Posted April 20, 2010 JavaScript. Here's a good solution: <a href="http://www.w3schools.com/" onclick="window.open(this.href); return false">Visit W3Schools!</a> Link to comment Share on other sites More sharing options...
jeffman Posted April 20, 2010 Share Posted April 20, 2010 I believe, in the spirit of semantic web, this is one more way of separating content from behavior. It's an odd choice, since a link is a "behavioral" element anyway. But that's my guess. Link to comment Share on other sites More sharing options...
Synook Posted April 20, 2010 Share Posted April 20, 2010 Or, does this stem from problems arising due to links opening in new windows? If so, what problems are being avoided by disallowing links to open new tabs or windows?Well, according to the W3C, until there is a way for user agents to stop links from opening in new windows if the user so desires, then it is preferable to not make links open in new windows and rather let the user make the decision. Link to comment Share on other sites More sharing options...
yertle Posted April 22, 2010 Author Share Posted April 22, 2010 Thank you all for the replies Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.