Post Reply 
Visits counter script
07-26-2011, 09:53 AM
Post: #1
Visits counter script
<script type="text/javaScript"><!--
var caution = false
function 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 = 1
else
visits = parseInt(visits) + 1
setCookie("counter", visits, now)
document.write('
Complimenti! Sei il ' + visits + '° visitatore.
');
// --></script>
User Tools
Quote this message in a reply


07-26-2011, 02:21 PM
Post: #2
RE: Visits counter script
It seem nice but there are a lot of free scripts counter that provide from some website for free so for who that lazy can use those for free.

Thank for sharing this code.

Millions Thank FreeVPS & LoomHosts for my lovely VPS8
User Tools
Quote this message in a reply
07-26-2011, 06:11 PM
Post: #3
RE: Visits counter script
I had have another one for php,but Thank you!
User Tools
Quote this message in a reply
07-26-2011, 11:10 PM
Post: #4
RE: Visits counter script
This just show how many time a client has visited the site. If the client browser does not enable javascript or cookies, this script won't work. Also does not work across browsers.



A side note on the php one, the problem is concurrency, results in lost updates. You must have a database-like mechanism to handler concurrency aspect of the web application.

Thân,

iCarrot.
User Tools
Quote this message in a reply
07-27-2011, 02:00 AM
Post: #5
RE: Visits counter script
Yup and it is simple also. I think I'll go with whos.amung.us

Patience has a limit and if you choose to be patient beyond this limit then it causes anger.
User Tools
Quote this message in a reply
08-20-2011, 08:56 PM
Post: #6
RE: Visits counter script
You can get very easy counter ...
I`m now using http://www.99counters.com/ - (HTML)!
but have very good style and very functions!
like who is online in your website..
Show your statics
When you was create the counter and more!
User Tools
Quote this message in a reply
08-20-2011, 10:39 PM
Post: #7
RE: Visits counter script
nero i m using similar ...
User Tools
Quote this message in a reply
08-20-2011, 10:42 PM
Post: #8
RE: Visits counter script
(08-20-2011 10:39 PM)jigiwigi Wrote:  nero i m using similar ...
lol i`m very active Big Grin

Can you type the website to view it?
User Tools
Quote this message in a reply
08-21-2011, 11:26 PM
Post: #9
RE: Visits counter script
Looks Nice. Smile

[Image: rule.gif]
User Tools
Quote this message in a reply
10-06-2011, 02:58 AM
Post: #10
RE: Visits counter script
Wow nice code..i'm going to test it now..Smile
User Tools
Quote this message in a reply
Post Reply 


Forum Jump:



User(s) browsing this thread:
1 Guest(s)