As reported by W3C some time ago, target="_blank" is not good authoring and will have an impact.
I wonder if you could, instead, implement a jscript function to open external links in a new window.
-Scott
As reported by W3C some time ago, target="_blank" is not good authoring and will have an impact.
I wonder if you could, instead, implement a jscript function to open external links in a new window.
-Scott
Before:
external link
After:
external linkfunction 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;As this is the kind of script you'll want to deploy across your entire site, you should copy this code into a separate file (e.g. external.js), and then load it in every page on your site with the following code, which should appear in the <head> tag of each document:
<script type="text/javascript" src="/external.js">
</script>
oops
where it said
external link
external link
its supposed to say
Before:
<a href="document.html" target="_blank">external link</a>
After:
<a href="document.html" rel="external">external link</a>Thank you!
When you say add the script inside the Head section of each document, does that mean every php file that has a head section? For my theme, I'm wondering if I could just add it to my header.php
-Scott
that's what it means translated into WP - header.php - these are quotes from an old article
Thank you!
This topic has been closed to new replies.