然后,在相同目录下新建一个popup.htm网页(注意要与上面的url对应!),用于显示在弹出窗口中。在新建文件的源代码中加入如下代码:
<script language="JavaScript">
function closeit() {
setTimeout("self.close()",10000)
}
closeit()
</script>
----------------------------------------------
说明 记录访客的来访次数,并根据作出不同的提示信息
效果 你已经光临本页3次!
常客,在本站的论坛发个帖子如何?
<SCRIPT language="JavaScript">
<!--
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)?""[s:3]"; expires="+expires.toGMTString()))+((path==null)?""[s:3]"; path="+path))+((domain==null)?""[s:3]"; domain="+domain))+((secure==true)?"; secure":"");
}
--------------------
<SCRIPT language="javascript">
<!--
function initArray()
{
for(i=0;i<initArray.arguments.length;i++)
this=initArray.arguments;
}
var isnMonths=new initArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var isnDays=new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日");
today=new Date();
hrs=today.getHours();
min=today.getMinutes();
sec=today.getSeconds();
clckh=""+((hrs>12)?hrs-12:hrs);
clckm=((min<10)?"0":"")+min;clcks=((sec<10)?"0":"")+sec;
clck=(hrs>=12)?"下午":"上午";
var stnr="";
var ns="0123456789";
var a="";
function getFullYear(d)
{
yr=d.getYear();if(yr<1000)
yr+=1900;return yr;}
document.write("<table>");