Phiên bản đầy đủ: jsB@nk » Cookie » Đếm số lượt truy cập web
URL: https://www.javascriptbank.com/visit-counter.html
Sử dụng các cookie để đếm số lượng truy cập đến website.
Phiên bản đầy đủ: jsB@nk » Cookie » Đếm số lượt truy cập web
URL: https://www.javascriptbank.com/visit-counter.html
<style>.counter{background-color:black;color:yellow;font-weight:bold;}</style><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<SCRIPT>expireDate = new DateexpireDate.setMonth(expireDate.getMonth()+6)jcount = eval(cookieVal("jaafarCounter"))jcount++document.cookie = "jaafarCounter="+jcount+";expires=" + expireDate.toGMTString()function cookieVal(cookieName) {thisCookie = document.cookie.split("; ")for (i=0; i<thisCookie.length; i++){if (cookieName == thisCookie[i].split("=")[0]){return thisCookie[i].split("=")[1]}}return 0}function page_counter(){for (i=0;i<(7-jcount.toString().length);i++)document.write('<span class="counter">0</span>')for (y=0;y<(jcount.toString().length);y++)document.write('<span class="counter">'+jcount.toString().charAt(y)+'</span>')}</SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<b>You visited this page <SCRIPT>page_counter(jcount);</SCRIPT> time(s).</b><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->