Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Open Links in new window


lstelie
Member

@lstelie

Hello,

I use for a pretty long time rel=”external” more compliant and this works well.

The following bit of code is from

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

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

If JS is not activated ? well no external link but the site is prefectly working

Skip to toolbar