Search results for 'setTime'. 1 post(s) found.
This Cookies records how many times the Visitor has visited the page and writes to the page accordingly.
visits.js
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 = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? 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 DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.Cookie = name "=" cval "; expires=" exp.toGMTString();
}
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
}
}
function getCookieVal(offset) {
var endstr = document.Cookie.indexOf (";",offset);
if (endstr == -1)
endstr = document.Cookie.length;
return unescape(document.Cookie.substring(offset,endstr));
}
function printOut() {
document.write("You've been here <b>" amt() "</b> times.");
}
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 = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? 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 DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.Cookie = name "=" cval "; expires=" exp.toGMTString();
}
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
}
}
function getCookieVal(offset) {
var endstr = document.Cookie.indexOf (";",offset);
if (endstr == -1)
endstr = document.Cookie.length;
return unescape(document.Cookie.substring(offset,endstr));
}
function printOut() {
document.write("You've been here <b>" amt() "</b> times.");
}
Visitor_test.html
<html>
<head>
<title>KURAPA.COM Visitor Test</title>
<script type="text/javascript" src="visits.js"></script>
</head>
<body>
<script type="text/javascript">
<!--
printOut()
//-->
</script>
<head>
<title>KURAPA.COM Visitor Test</title>
<script type="text/javascript" src="visits.js"></script>
</head>
<body>
<script type="text/javascript">
<!--
printOut()
//-->
</script>
Another posts included in "HTML, Javascript"
| How to record visitor's name by Cookie (0) | 2007/08/29 |
| Save And Restore Form Cookies in Javascript (0) | 2007/08/30 |
| Let popup once for event dialog or something like that in Javascript (0) | 2007/08/30 |
| Cross Browser Event Management Functions Using JavaScript (0) | 2007/08/29 |
| Printing A Page (0) | 2007/08/26 |
| Example Of Creating Objects (0) | 2007/08/26 |
| Shake Your Window.... (0) | 2007/08/26 |
| Linking Drop Downs (0) | 2007/08/26 |
Trackback : Cannot send a trackbact to this post.
-
Subject Free vintage porn galleries.
2008/12/29 00:10
Free porn video. Free online porn games. Totally free porn. Free porn samples.
-
Subject different money making ideas
2010/01/29 00:59
moneyideas
-
Subject different money making ideas
2010/01/29 09:16
moneyideas
-
Subject different money making ideas
2010/01/31 16:44
moneyideas

Prev

Rss Feed