I tried the JavaScript code in my header.php and it works great! But I can not get it to validate…
InValid XHTML
Placed right after the </style>
<script type="text/javascript">
function makeNewWindows() {
if (!document.links) {
document.links = document.getElementsByTagName('a');
}
for (var t=0; t<document.links.length; t++) {
var extlinks = document.links[t];
if (extlinks.href.search(/http/) != -1) {
if (extlinks.href.search('bluetoothwirelesslife.com') == -1) {
extlinks.setAttribute('target', '_blank');
}
}
}
}
window.onload = function(e) {makeNewWindows();}
</script>
Any ideas on how to validate the javascript?