語法展示:: http://home.graffiti.net/gfghgfhf/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<head>及</head>標籤之間。
<script language="JavaScript">
<!--
function getCookieVal (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 getCookieVal (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" : "");
}
function DisplayInfo()
{
var expdate = new Date();
var visit;
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
if(!(visit = GetCookie("visit")))
visit = 0;
visit++;
SetCookie("visit", visit, expdate, "/", null, false);
var message;
if(visit == 1)
message="注意看次數和訊息會變化ㄚ";
if(visit == 2)
message="要常來喔";
if(visit == 3)
message="哈哈..嘿嘿..";
if(visit == 4)
message="嗯......不知要說啥了......";
if(visit == 5)
message="國泰民安 世界和平";
if(visit >= 6)
message="記得將本站加入最愛喔 ^_^";
alert("\n"+"參觀本頁次數:第"
+" "+visit+""
+" 次"+"\n"+"\n"
+message);
}
-->
</script>在 message="注意看次數和訊息會變化ㄚ"; 中修改要顯示的文字 自行增減訊息的數量,只要最後一條訊息改成>=就好(意思就是當次數>或=這一次時,一律使用此訊息)
將以下程式碼複製,貼在插入<body >標籤裡面。
onload="DisplayInfo()"
留言列表