pv.js

来自「JSP的网上商城的代码。只是小部分。希望大家能够多看看。一起学习。」· JavaScript 代码 · 共 47 行

JS
47
字号
if(typeof(pvhitimgview)=="undefined"){
	var pvhitimgview=true;
	function pv_rport(dm,f) {
	  var i = dm.indexOf(f);
	  if (i > 0) {
	    return  dm.substring(0, i);
	  }
	  return dm;
	}
	
	function pv_d(){
		var now = new Date().getTime();
	  	var datestr=escape(now*1000+Math.round(Math.random()*1000));
		    datestr+="befrombj";
	  	var imgsrc='';
		
	  	//增加产品线统计
	  	if(typeof(pv_subcatid)=="undefined")
	  		pv_subcatid=0;
	  	
		if(top.location==self.location){
			imgsrc='http://pv.zol.com.cn/images/pvhit0001.gif?t='+datestr+'&subcat='+pv_subcatid+'&'+document.referrer;
		}else {
			var d=document.referrer+'';
			d=d.substr(7);
			d=pv_rport(d,'/');
			d=pv_rport(d,':');
			
			if(d.substr(d.length-10)=='zol.com.cn' || d.substr(d.length-10)=='google.com' || d.substr(d.length-9)=='qihoo.com' || d.substr(d.length-9)=='baidu.com'|| d.substr(d.length-8)=='3721.com' || d.substr(d.length-8)=='1sou.com' || d.substr(d.length-10)=='pku.edu.cn' || d.substr(d.length-16)=='sanhaostreet.com' || d.substr(d.length-11)=='ibox.com.cn' || d.substr(d.length-12)=='fengniao.com')
				imgsrc='http://pv.zol.com.cn/images/pvhit0002.gif?t='+datestr+'&subcat='+pv_subcatid+'&'+document.referrer;
			else imgsrc='';
			
			//imgsrc='http://pv.zol.com.cn/images/pvhit0002.gif?t='+datestr+'&'+document.referrer;
		}
		
		if(imgsrc!='') document.write('<img border=0 width=1 height=1 src="'+imgsrc+'">');
	}


	/*
	if(location.href.indexOf('download.zol.com.cn')>0){
		document.write("<iframe src='http://js.zol.com.cn/dns.html' border=0 width=0 height=0 style='display:none'></iframe>");
	}
	*/
	pv_d();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?