Javascript| counter
<script language= "JavaScript" >
<!--
function www_webjx_com (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_webjx_com (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;visits++; 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 to visit this page" + "<font color=red>" +visits+ "</FONT>" + "Times! ");
if (visits==1)//visit 1 times of information display
document.write ("<br>" + "Welcome to the site, feel the content of this site?" ");
if (visits==2)//Visit 2 times The information shows, the following analogy, oneself casually increase
document.write ("<br>" +) Come again Jong! Welcome to click on this site ads. ");
if (visits==3)
document.write ("<br>" + "regulars, in the forum of this site to send a post how?" ");
if (visits==4)
document.write ("<br>" + "you lunatic!");
if (visits>=5)
document.write ("<br>" + "crazy guy!") I really like you very much. ");
-->
</SCRIPT>