Greenguy's Board


Go Back   Greenguy's Board > Newbie Questions
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2012-09-15, 01:46 PM   #1
Maj. Stress
Progress rarely comes in buckets, it normally comes in teaspoons
 
Maj. Stress's Avatar
 
Join Date: Jun 2005
Location: Dark Side Of Naboo
Posts: 1,289
Quote:
Originally Posted by Greenie View Post
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.
Maj. Stress is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:55 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc