PDA

View Full Version : XHTML 1.0 Strict Open in New Window



shield
11-24-2005, 10:09 AM
Just come across a bit of a problem...

XHTML Strict 1.0 has dropped the target="" tag meaning I cant open extrenal links in a new window.

I tried using the following Javscript to do it which worked but then it says that the code isnt valid XHTML. The javascript code throws it off...


function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;

How can the above code be corrected to be compliant or maybe a different way around it?

Thanks

tony
11-24-2005, 10:56 AM
http://www.sitepoint.com/article/standards-compliant-world/3
http://accessify.com/features/tutorials/the-perfect-popup/

may be of use?

pfgannon
11-25-2005, 01:22 AM
WOW I'm pretty good about XHTML bu I had no idea that the taget tag had been deprecated.

ryan
09-05-2006, 03:14 AM
god thats news to me