<script type="text/javascript">
var comp = new RegExp(location.hostname);

jQuery('a').each(function(){
 //location.hostname === this.hostname || !this.hostname.length 
   if(comp.test(jQuery(this).attr('href'))){
       // a link that contains the current host           
       jQuery(this).addClass('local');
   }
   else{
       // a link that does not contain the current host
       jQuery(this).attr('rel','nofollow');
   }
});
</script>

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *