复制代码代码如下:
função www_helpor_net (deslocamento) {
var endstr = document.cookie.indexof (";", deslocamento);
if (endstr == -1)
endstr = document.cookie.length;
return unescape (document.cookie.substring (deslocamento, endstr));
}
função getcookie (nome) {
var arg = nome + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
enquanto (i <clen) {
var j = i + Alen;
if (document.cookie.substring (i, j) == arg)
retornar www_helpor_net (j);
i = document.cookie.indexof ("", i) + 1;
if (i == 0)
quebrar;
}
retornar nulo;
}
função setcookie (nome, valor) {
var argv = setCookie.arguments;
var argc = setCookie.argudents.length;
var expira = (2 <argc)? argv [2]: nulo;
var caminho = (3 <argc)? argv [3]: nulo;
var domain = (4 <argc)? argv [4]: nulo;
var seguro = (5 <argc)? argv [5]: falso;
document.cookie = nome
+ "="
+ Escape (valor)
+ ((expira == null)? "": ("; expira =" + expira
.togmtString ()))
+ ((Path == NULL)? "": ("; PATH =" + PATH)))
+ ((domain == null)? "": ("; domain =" + domain)))
+ ((seguro == true)? "; seguro": "");
}
var expDate = new Date ();
visitas var;
expstate.setTime (expDate.gettime () + (24 * 60 * 60 * 1000 * 365)); // biscoitos 时间为 1 年, 自己随便设置该时间
if (! (visits = getCookie ("visitas"))) {
visitas = 0;
}
var OldjessionId = getCookie ("OldJSessionId");
if (! OldjessionId) {
OldjessionId = "111";
}
var newjessionId = getCookie ("JSessionId");
if (OldJessionId! = newjessionId) {
visitas ++;
Setcookie ("OldjSessionId", newjessionId, expdate "/", null, false);
Setcookie ("visitas", visitas, expdate, "/", null, false);
}
// 以下信息显示可以使用标准的 html 语法, 自己随便设置
document.write ("你已经光临本页" + "<font color = red>" + visita + "</font>" + "次!");
// 当登录次数达到三次 , 就自动调用函数 , 隐藏弹出框 , 如果只要记录登录次数 , 下边代码可以忽略
if (visitas> 3) {
setInterval ("ChangeH ('Down')", 2);
} */