So, I found some awesome code for making the links in ones website open in a new tab. It works, a little too well, I think. After a few days I realized that the same effect was being applied to the buttons in my *navigation bar*, lool.
Is there any way to restrict this to just specific links? http://philipos.com.
Thanks again.
Philip
http://philipos.com
Is there any way to restrict this to just specific links? http://philipos.com.
<script type="text/javascript">
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.target = "_blank";
}
}
window.onload = externalLinks;
</script>
Thanks again.
Philip
http://philipos.com


