yertle Posted April 20, 2010 Report Share Posted April 20, 2010 (edited) 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? Edited April 20, 2010 by yertle Link to comment Share on other sites More sharing options...
Err Posted April 20, 2010 Report Share Posted April 20, 2010 (edited) JavaScript. Here's a good solution: <a href="http://www.w3schools.com/" onclick="window.open(this.href); return false">Visit W3Schools!</a> Edited April 20, 2010 by Err Link to comment Share on other sites More sharing options...
jeffman Posted April 20, 2010 Report 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 Report 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 Report Share Posted April 22, 2010 Thank you all for the replies Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now