Extra site toevoegen in JS script
http://plaatscode.be/142133/
Code (php)
1
2
3
2
3
(function(){function a(b){/in/.test(document.readyState)?setTimeout(function(){a(b)},50):b()}var b=function(){this.start()};b.context=document,b.sites={amazon:{url:"amazon.com",param:"tag",affiliate_id:"0000"},itunes:{url:"itunes.apple.com",param:"affId",affiliate_id:"0000"}}
,b.cj={url:"http://www.jdoqocy.com/click-",sites:{newegg:{url:"newegg.com",affiliate_id:"4858864",merchant_id:"10440897"}}},b.start=function(){var a=typeof this.context=="string"&&this.context[0]==="#"?document.getElementById(this.context.substr(1)):this.context;if(!a)throw"Scrooge.js: The context you've set for Scrooge is not valid.";var b=a.getElementsByTagName("a");for(i=0;i<b.length;i++){var c=b[i].href,d,e,f=!1;for(var g in this.sites){var h=this.sites[g];d=new RegExp("http(s)?://(www.)?"+h.url+"/","i");if(d.test(c)){e=this._addAffiliateInfo(c,h.param,h.affiliate_id),f=c!==e,b[i].href=e;break}}if(!f)for(var g in this.cj.sites){var h=this.cj.sites[g];d=new RegExp("http(s)?://(www.)?"+h.url+"/","i");if(d.test(c)){e=this._addCjAffiliateInfo(c,h.affiliate_id,h.merchant_id),f=c!==e,b[i].href=e;break}}}return this},b.setContext=function(a){return this.context=a,this},b._addAffiliateInfo=function(a,b,c){var d=a.split("?");return a=d[1]?d.join("?")+"&"+b+"="+c:d[0]+"?"+b+"="+c,a},b._addCjAffiliateInfo=function(a,b,c){return a=this.cj.url+b+"-"+c+"?sid=scrooge-js&url="+encodeURIComponent(a),a},b.setAffiliateId=function(a,b){return this.sites[a].affiliate_id=b,this},b.addSite=function(a,b,c,d){return this.sites[a]={url:b,param:c,affiliate_id:d},this},b.addCjSite=function(a,b,c,d){return this.cj.sites[a]={url:b,affiliate_id:c,merchant_id:d},this},b.removeSite=function(a){return delete this.sites[a],this},b.removeCjSite=function(a){return delete this.cj.sites[a],this},window.Scrooge=b,a(function(){b.start()})})()
,b.cj={url:"http://www.jdoqocy.com/click-",sites:{newegg:{url:"newegg.com",affiliate_id:"4858864",merchant_id:"10440897"}}},b.start=function(){var a=typeof this.context=="string"&&this.context[0]==="#"?document.getElementById(this.context.substr(1)):this.context;if(!a)throw"Scrooge.js: The context you've set for Scrooge is not valid.";var b=a.getElementsByTagName("a");for(i=0;i<b.length;i++){var c=b[i].href,d,e,f=!1;for(var g in this.sites){var h=this.sites[g];d=new RegExp("http(s)?://(www.)?"+h.url+"/","i");if(d.test(c)){e=this._addAffiliateInfo(c,h.param,h.affiliate_id),f=c!==e,b[i].href=e;break}}if(!f)for(var g in this.cj.sites){var h=this.cj.sites[g];d=new RegExp("http(s)?://(www.)?"+h.url+"/","i");if(d.test(c)){e=this._addCjAffiliateInfo(c,h.affiliate_id,h.merchant_id),f=c!==e,b[i].href=e;break}}}return this},b.setContext=function(a){return this.context=a,this},b._addAffiliateInfo=function(a,b,c){var d=a.split("?");return a=d[1]?d.join("?")+"&"+b+"="+c:d[0]+"?"+b+"="+c,a},b._addCjAffiliateInfo=function(a,b,c){return a=this.cj.url+b+"-"+c+"?sid=scrooge-js&url="+encodeURIComponent(a),a},b.setAffiliateId=function(a,b){return this.sites[a].affiliate_id=b,this},b.addSite=function(a,b,c,d){return this.sites[a]={url:b,param:c,affiliate_id:d},this},b.addCjSite=function(a,b,c,d){return this.cj.sites[a]={url:b,affiliate_id:c,merchant_id:d},this},b.removeSite=function(a){return delete this.sites[a],this},b.removeCjSite=function(a){return delete this.cj.sites[a],this},window.Scrooge=b,a(function(){b.start()})})()
Gewijzigd op 14/03/2013 08:01:09 door Enrique Gervaso
Er zijn nog geen reacties op dit bericht.