就想游城市

快捷导航
登录 |注册居民 |
查看: 3222|回复: 0

统计网友的来访次数

[复制链接]
发表于 2008-7-4 17:28:44 | 显示全部楼层 |阅读模式

加入城市,听原创电台,写情感文字,分享你的一切。

您需要 登录 才可以下载或查看,没有帐号?注册居民

x

拷贝下面的代码到你的html文件的<body>和</body>之间
<script LANGUAGE="JavaScript">
<!--var caution = falsefunction setCookie(name, value, expires, path, domain, secure) {        var curCookie = name + "=" + escape(value) +                ((expires) ? "; expires=" + expires.toGMTString() : "") +                ((path) ? "; path=" + path : "") +                ((domain) ? "; domain=" + domain : "") +                ((secure) ? "; secure" : "")        if (!caution || (name + "=" + escape(value)).length <= 4000)                document.cookie = curCookie        else                if (confirm("Cookie exceeds 4KB and will be cut!"))                        document.cookie = curCookie}function getCookie(name) {        var prefix = name + "="        var cookieStartIndex = document.cookie.indexOf(prefix)        if (cookieStartIndex == -1)                return null        var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)        if (cookieEndIndex == -1)                cookieEndIndex = document.cookie.length        return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))}function deleteCookie(name, path, domain) {        if (getCookie(name)) {                document.cookie = name + "=" +                 ((path) ? "; path=" + path : "") +                ((domain) ? "; domain=" + domain : "") +                "; expires=Thu, 01-Jan-70 00:00:01 GMT"        }}function fixDate(date) {        var base = new Date(0)        var skew = base.getTime()        if (skew > 0)                date.setTime(date.getTime() - skew)}var now = new Date()fixDate(now)now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000)var visits = getCookie("counter")if (!visits)        visits = 1else        visits = parseInt(visits) + 1setCookie("counter", visits, now)document.write("您已来这儿" + visits + "次.")// -->
</script>

这是个寂寞却幸福的城市,这是个声音与耳朵相恋的城市 93you.com
您需要登录后才可以回帖 登录 | 注册居民

本版积分规则

唯一的遗憾是我们连一张合照都没有。

就想游设计 ( 桂ICP备13002329 | 桂公网安备 45030502000286号 )|手机版|Archiver|Sitemap

Powered by Discuz! © 2007-2025 就想游城市原创风格 Jokke Design

GMT+8, 2025-6-7 04:16