Posted By

cartercole on 08/07/10


Tagged

check link test seo attribution


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

cartercole


Enforce link attribution requirements for SEO


 / Published in: JavaScript
 

URL: http://blog.cartercole.com/2010/07/enforce-your-link-attribution.html

uses JavaScript to check DOM for proper clean linkback to widget source

  1. (function(){var a=new RegExp("http://cartercole.com","i"),b=document.getElementsByTagName("meta"),c=b.length,d=false,e=document.links,f=e.length;for(i=0;i<f;i++)if(a.test(e[i].href))/nofollow/i.test(e[i].rel)||(d=true);for(i=0;i<c;i++)if(b[i].name.toLowerCase()=="robots")if(/nofollow/i.test(b[i].content))d=false;if(!(d)){
  2. window.open("http://cartercole.com");//run if clean link isnt found
  3. }})()

Report this snippet  

You need to login to post a comment.