Cookie foutje

vbimport

#1

waar zit de fout?

<HTML>
<HEAD>
<TITLE>test</TITLE>

<SCRIPT language=“javascript1.2”>
daysToKeep = 14; // default cookie life…
theCookie = ‘’;
today = new Date();
expiryDate = new Date(today.getTime() + (daysToKeep * 86400000));

/* Cookie functions originally by Bill Dortsch */

function setCookie (name,value,expires,path,theDomain,secure) {
value = escape(value);
var theCookie = name + “=” + value +
((expires) ? “; expires=” + expires.toGMTString() : “”) +
((path) ? “; path=” + path : “”) +
((theDomain) ? “; domain=” + theDomain : “”) +
((secure) ? “; secure” : “”);
document.cookie = theCookie;
}

function getCookie(Name) {
var search = Name + “=”
if (document.cookie.length > 0) { // if there are any cookies
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset)
// set index of end of cookie value
if (end == -1) end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
}
}
function delCookie(name,path,domain) {
if (getCookie(name)) document.cookie = name + “=” +
((path) ? “;path=” + path : “”) +
((domain) ? “;domain=” + domain : “”) +
“;expires=Thu, 01-Jan-70 00:00:01 GMT”;
}
</SCRIPT>

<SCRIPT language=“javascript1.2”>
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all) ? true : false;
function show(id) {
if (ns4) document.layers[id].visibility = “show”;
else if (ie4) document.all[id].style.visibility = “visible”;
}
function hide(id) {
if (ns4) document.layers[id].visibility = “hide”;
else if (ie4) document.all[id].style.visibility = “hidden”;
}
function toggle(id) {
if (isVisible(id)) hide(id);
else if (id==‘waterMark’ && getCookie(id)==‘yes’) show(id);
}
function markMe() {
setVals();
window.onresize=setVals;
markID = setInterval (“wRefresh()”,markRefresh);
document.checkCook.showCheck.checked=(getCookie(‘waterMark’)==‘yes’);
}
</script>

<STYLE type=text/css>#waterMark {
LEFT: 150px; POSITION: absolute; TOP: 150px; VISIBILITY: hidden; Z-INDEX: 1
}
</STYLE>

</HEAD>

<BODY leftMargin=0 topMargin=0 MARGINHEIGHT=“0” MARGINWIDTH=“0”>

<DIV id=waterMark style=“LEFT: 544px; POSITION: absolute; TOP: 58px”> Hier komt het menu</DIV>

<center><a href=“javascript:toggle(‘waterMark’);”>toggle</a></center>

<form name=“checkCook”>
<input type=“checkbox” NAME=“showCheck” onClick="
val=(this.checked)?‘yes’:‘no’;
setCookie(‘waterMark’,val,expiryDate);">Show layer next time?
</form>

</BODY>
</HTML>

zie http://members.ams.chello.nl/l.kattestaart/test/memberlist.html tis dus de bedoeling dat via een cookie word onthouden wat de bezoeker kiest (navigatie aan of uit)