/ Published in: JavaScript
uses JavaScript to check DOM for proper clean linkback to widget source
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
(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)){ window.open("http://cartercole.com");//run if clean link isnt found }})()
URL: http://blog.cartercole.com/2010/07/enforce-your-link-attribution.html