复制代码代码如下:
fonction www_helpor_net (offset) {
var endstr = document.cookie.indexof (";;", offset);
if (endstr == -1)
endstr = document.cookie.length;
return Unescape (document.cookie.substring (Offset, ENDSTR));
}
fonction getcookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i <clen) {
var j = i + alen;
if (document.cookie.substring (i, j) == arg)
return www_helpor_net (j);
i = document.cookie.indexof ("", i) + 1;
si (i == 0)
casser;
}
retourner null;
}
fonction setcookie (nom, valeur) {
var argv = setcookie.arguments;
var argc = setcookie.argments.length;
var expire = (2 <argc)? Argv [2]: null;
var path = (3 <argc)? Argv [3]: null;
var domain = (4 <argc)? Argv [4]: null;
var sécurisé = (5 <argc)? argv [5]: false;
document.cookie = nom
+ "="
+ Escape (valeur)
+ ((expire == null)? "": ("; expire =" + expire
.TogmTString ()))
+ ((path == null)? "": ("; path =" + path))
+ ((domaine == null)? "": ("; domaine =" + domaine))
+ ((sécurisé == true)? "; Secure": "");
}
var expdate = new Date ();
Var visites;
expdate.setTime (expdate.getTime () + (24 * 60 * 60 * 1000 * 365)); // 设置 Cookies 时间为 1 年, 自己随便设置该时间
if (! (visites = getcookie ("visites"))) {
visites = 0;
}
var oldjessionid = getcookie ("oldjSessionId");
if (! oldjessionid) {
OldjessionId = "111";
}
var newjessionid = getcookie ("jSessionId");
if (oldjessionid! = newjessionid) {
visites ++;
Setcookie ("oldjSessionId", newjessionid, expdate, "/", null, false);
Setcookie ("visites", visites, expdate, "/", null, false);
}
// 以下信息显示可以使用标准的 html 语法, 自己随便设置
document.write ("你已经光临本页" + "<font color = red>" + visites + "</font>" + "次!");
// 当登录次数达到三次 , 就自动调用函数 , 隐藏弹出框 , 如果只要记录登录次数 , 下边代码可以忽略
if (visites> 3) {
setInterval ("changeh ('down')", 2);
} * /