Copy Code code as follows:
function Www_helpor_net (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr = = 1)
Endstr = Document.cookie.length;
Return unescape (document.cookie.substring (offset, endstr));
}
function 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;
if (i = = 0)
Break
}
return null;
}
function Setcookie (name, value) {
var argv = setcookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < ARGC)? ARGV[2]: null;
var path = (3 < ARGC)? ARGV[3]: null;
var domain = (4 < ARGC)? ARGV[4]: null;
var secure = (5 < ARGC)? ARGV[5]: false;
Document.cookie = Name
+ "="
+ Escape (value)
+ ((expires = null)? "" : ("; Expires= "+ Expires
. toGMTString ()))
+ ((path = null)? "" : ("; Path= "+ path))
+ (domain = null)? "" : ("; domain= "+ domain)"
+ (Secure = = True)? "; Secure ":" ");
}
var expdate = new Date ();
var visits;
Expdate.settime (Expdate.gettime () + (24 * 60 * 60 * 1000 * 365)); Set the cookie time for 1 years, you set the time casually
if (!) ( visits = GetCookie ("visits"))) {
visits = 0;
}
var Oldjessionid = GetCookie ("Oldjsessionid");
if (!oldjessionid) {
Oldjessionid = "111";
}
var Newjessionid = GetCookie ("Jsessionid");
if (Oldjessionid!= Newjessionid) {
visits++;
Setcookie ("Oldjsessionid", Newjessionid, Expdate, "/", null, FALSE);
Setcookie ("Visits", visits, Expdate, "/", null, FALSE);
}
The following information shows that you can use the standard HTML syntax and set yourself casually
document.write ("You have come to this page" + "<font color=red>" + visits + "</FONT>" + "Times! ");
When the number of logins reached three times, automatically call the function, hide the pop-up box, if you log the number of logins, the bottom code can be ignored
if (Visits > 3) {
SetInterval ("Changeh (' Down ')", 2);
} */