Monday 28 January 2008

XHTML-compliant links: There is no attribute "target"

The traditional way to open links in a new window was to use target="_blank". This is non-valid XHTML. The error on the W3 validator is “there is no attribute "target".” The editor in Sitecore 5.2 generates target="_blank". I haven’t yet tried other versions.

There’s an interesting work-around on here:

http://www.sitepoint.com/article/standards-compliant-world


In short, they attach target="_blank" using JavaScript.

It seems like a fudge just to bypass the check, but the author argues it’s perfectly valid approach. The only downside is the reliance on JavaScript.

No comments: