čau, mam cookie, která zobrazuje čas poslední návštěvy a zobrazuje se mi jen v IE a v Mozille ne...
neví někdo proč?
kód: ( můžete si ho zobrazit zde: http://sweb.cz/nj.teplice/lastcookie.html )
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="demo stranka2" />
<meta name="keywords" content="" />
<script type="text/javascript">
var expDays = 365;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function When(){
var rightNow = new Date()
var WWHTime = 0;
WWHTime = GetCookie('WWhenH')
WWHTime = WWHTime * 1
var lastHereFormatting = new Date(WWHTime);
var intLastVisit = (lastHereFormatting.getYear() * 10000)+(lastHereFormatting.getMonth() * 100) + lastHereFormatting.getDate()
var lastHereInDateFormat = "" + lastHereFormatting.toLocaleString();
var lastHereInDateFormat2 = "" + lastHereFormatting;
var dayOfWeek = lastHereInDateFormat2.substring(0,3)
if (dayOfWeek=="Sun"){dayOfWeek="v neděli"};
else if (dayOfWeek=="Mon"){dayOfWeek="v pondělí"};
else if (dayOfWeek=="Tue"){dayOfWeek="v úterý"};
else if (dayOfWeek=="Wed"){dayOfWeek="ve středu"};
else if (dayOfWeek=="Thu"){dayOfWeek="ve čtvrtek"};
else if (dayOfWeek=="Fri"){dayOfWeek="v pátek"};
else if (dayOfWeek=="Sat"){dayOfWeek="v sobotu"};
var dateMonth = lastHereInDateFormat.substring(0,17);
var timeOfDay = lastHereInDateFormat.substring(18,26);
var WWHText = dayOfWeek + " " + dateMonth + " v " + timeOfDay;
SetCookie ("WWhenH", rightNow.getTime(), exp);
p=document.getElementsByTagName("p");
p[0].innerHTML=WWHText;
}
function set(){
SetCookie ('WWhenH', 0, exp);
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
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 document.write("Toto je Vaše první návštěva");
}
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();
}
</script>
</head>
<body onload="When()">
<p>
</p>
</body>
</html>