/* * @Author: jct * @Date: 2020-11-16 14:43:52 * @Last Modified by: jct1991 * @Last Modified time: 2020-11-19 09:26:55 */ function Jct_stat(){ this.domain = '//'+window.location.host; this.Jct_ckpre = 'stat_'; this.Jct_ckpat = '/'; this.xmlHttp = null; this.Try = { these: function() { var returnValue; for (var i = 0; i < arguments.length; i++) {var lambda = arguments[i]; try {returnValue = lambda(); break;} catch (e) {}} return returnValue; } } this.init = function(){ var today_time = this.today_endttime()-86400000; var today_endtime = this.today_endttime(); var s = '&fsv='+this.get_falsh_version()+';'+this.get_screen()+';'+this.get_site_url()+';'+this.get_ref(); s += '&sys=dXNlcl9pZD0wJm1pZD0xJml0ZW1pZD0xNDI='; var nuvtime = this.gck('nuvtime'); if(!nuvtime){ this.sck('nuvtime',new Date().getTime(),new Date().getTime()+365*60*60*24*1000); s += '&nuv=1'; } var uvtime = this.gck('uvtime'); if(!uvtime){ this.sck('uvtime',new Date().getTime(),today_endtime); s += '&uv=1'; } img_src = this.domain+'/stat?'+s setTimeout('_img = new Image;_img.src=img_src;', 0); } this.today_endttime = function(){ var o = new Date(); o.setHours(23); o.setMinutes(59); o.setSeconds(59); o.setMilliseconds(999); return o.getTime(); } this.get_falsh_version = function() { return "0" } //分辨率 this.get_screen = function() { var s = window.screen; return s.width + "x" + s.height; } //中文替换 this.zh_replace = function (s) { if (!s) return ""; str = s.replace(/[\u4E00-\u9FA5]/ig, "x"); return str; } //当前网址 this.get_site_url = function () { var s; try { s = window.top.document.location.href; } catch(e) { s = document.location.href; }; if (s) { return escape(this.zh_replace(s)) } else { return ""; }; } //来源 this.get_ref = function () { var r; try { r = window.top.document.referrer; } catch(e) { r = document.referrer; }; if (r) { return escape(r) } else { return ""; }; } this.makeRequest = function (queryString, php, func, method) { this.xmlHttp = this.Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ); method = (typeof method == 'undefined') ? 'post' : 'get'; if(func) xmlHttp.onreadystatechange = eval(func); this.xmlHttp.open(method, method == 'post' ? php : php+'?'+queryString, true); this.xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); this.xmlHttp.send(method == 'post' ? queryString : null); } this.sck = function (n, v, s) { var e = ''; e = new Date(s); e = "; expires=" + e.toGMTString(); document.cookie = this.Jct_ckpre + n + "=" + v + ((this.Jct_ckpat == "") ? "" : ("; path=" + this.Jct_ckpat)) + e; } this.gck = function (n) { var v = ''; var s = this.Jct_ckpre + n + "="; if(document.cookie.length > 0) { o = document.cookie.indexOf(s); if(o != -1) { o += s.length; end = document.cookie.indexOf(";", o); if(end == -1) end = document.cookie.length; v = unescape(document.cookie.substring(o, end)); } } return v; } this.dck = function (n) {var e = new Date((new Date()).getTime() - 1 ); e = "; expires=" + e.toGMTString(); document.cookie = this.Jct_ckpre + n + "=" + escape("") +";path=/"+ e;} } var stat = new Jct_stat(); stat.init();