簡單的JSt統計靜態網站訪問次數

來源:互聯網
上載者:User

標籤:func   generator   java   ==   page   lan   com   nbsp   str   

最簡單的靜態頁面重新整理

 1 <html> 2 <head> 3 <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 4 <title>New Page 5</title> 5 <meta name="GENERATOR" content="Microsoft FrontPage 3.0"> 6 <script language="JavaScript"> 7 <!-- 8 var caution = false 9 function setCookie(name, value, expires, path, domain, secure) {10 var curCookie = name + "=" + escape(value) +((expires) ? "; expires=" + expires.toGMTString() : "") +((path) ? "; path=" + path : "") +((domain) ? "; domain=" + domain : "") +((secure) ? "; secure" : "")11 if (!caution || (name + "=" + escape(value)).length <= 4000)12 document.cookie = curCookie13 else if (confirm("Cookie exceeds 4KB and will be cut!"))14 document.cookie = curCookie15 }16 function getCookie(name) {17 var prefix = name + "="18 var cookieStartIndex = document.cookie.indexOf(prefix)19 if (cookieStartIndex == -1)20 return null21 var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)22 if (cookieEndIndex == -1)23 cookieEndIndex = document.cookie.length24 return unescape(document.cookie.substring(cookieStartIndex + prefix.length,25 cookieEndIndex))26 }27 function deleteCookie(name, path, domain) {28 if (getCookie(name)) {29 document.cookie = name + "=" +((path) ? "; path=" + path : "") +((domain) ? "; domain=" + domain : "") +"; expires=Thu, 01-Jan-70 00:00:01 GMT"30 }31 }32 function fixDate(date) {33 var base = new Date(0)34 var skew = base.getTime()35 if (skew > 0)36 date.setTime(date.getTime() - skew)37 }38 var now = new Date()39 fixDate(now)40 now.setTime(now.getTime() + 730 * 24 * 60 * 60 * 1000)41 var visits = getCookie("counter")42 if (!visits)43 visits = 144 else45 visits = parseInt(visits) + 146 setCookie("counter", visits, now)47 document.write("<font size=6 color=red>歡迎您,您是第:" + visits + " 個訪問該網站的訪客")48 // -->49 </script>50 </head>51 <body>52 <p align="right"> </p>53 </body>54 </html>

 

 

簡單的JSt統計靜態網站訪問次數

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.