HAVE CLIENT-SIDE FORM COOKIE GET AND SET FUNCTIONS IN THE SECOND WINDOW DOCUMENT EXTERNAL JS.FILE OF A DUMY TEST SITE FOLDER ON MYCOMPUTER. IE8 THROWS 'SYNTAX ERROR' ON THE 'WINDOW.LOAD=FUNCTION, FIRST COOKIE FUNCTION HIGHLIGHTED'. CAN I ACTUALLY TEST COOKIES ON A TEST SITE ON MY COMPUTER WITHOUT THE SERVER (MYCOMPUTER) OR A DOMAIN NAME? YEAH NO HECKLING FROM THE PEANUT GALLERY.:$
THIS IS THE ONLOAD FUNCTION I'M USING. ANY HELP WOULD BE GREATLY APPRECIATED.
// global variables.
domain = 'file:///C:/Documents%20and%20Settings/new%20user/My%20Documents/mexicali/checkout.html';
path = '/mexicali/';
secure = 0;
// function to retrieve a field.
function getC(obj) {
var cookie = '', realvalue = '';
cookie = document.cookie;
var objType = new String(obj.type);
if (obj.name)
var objName = new String(obj.name);
else
var objName = new String(obj[0].name);
var cstart = cookie.indexOf(objName + '=[');
if (cstart == -1) return 1;
var cstartlength = objName.length + 2;
cstart = cstart + cstartlength;
var cend = cookie.indexOf(']', cstart);
realvalue = cookie.substring(cstart, cend);
switch(objType.toLowerCase()) {
case "checkbox" :
if(realvalue == '1') obj.checked = 1;
else obj.checked = 0;
break;
case "undefined" :
obj[realvalue].checked = 1;
break;
case "select-one" :
obj.selectedIndex = realvalue;
break;
case "select-multiple" :
for (var i = 0; i < obj.options.length; i++) {
if ((realvalue.indexOf('+' + i)) > -1)
obj.options[i].selected = 1;
else
obj.options[i].selected = 0;
}
break;
default :
obj.value = realvalue;
break;
}
return 1;
}
window.onload= getC(this.countryname);
getC(this.firstname);//ERROR 'NOT IMPLIMENTED' THROWN.
getC(this.lastname);
getC(this.company);
getC(this.address);
getC(this.address);
getC(this.city);
getC(this.statename);
getC(this.postalcode);
getC(this.phone);