Enforce link attribution requirements for SEO


/ Published in: JavaScript
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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. }})()

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.