Quote:
Originally Posted by Greenie
cd34 wrote up this handy bit of code to open all external links in a new window/tab
Code:
<script type="text/javascript">
<!--
var localdomain='link-o-rama.com';
var hrefs = document.getElementsByTagName("a");
for (var i=0, max=hrefs.length; i<max; i++) {
if (hrefs[i].href.indexOf(localdomain) == -1) {
hrefs[i].target='_blank';
}
};
// -->
</script>
Just change link-o-rama.com to your domain & put this above the </body> tag
|
Thanks for that bit of code. I have a good use for it.