//读取cookiefunction getCookie{var arr = document.cookie.match(new
RegExp”+name+”=;ifreturn unescape;return null;}

///删除cookiefunction delCookie{var exp = new Date();exp.setTime;var
cval=getCookie document.cookie= name +
“=”+cval+”;expires=”+exp.toGMTString();}

js对cookie的写入,读取及删除。

/*name:cookie 名value:cookie 值*///写入cookiefunction SetCookie{var
Days = 30; //此 cookie 将被保存 30 天var exp = new Date();exp.setTime +
Days*数据解读 ,24*60*60*1000);document.cookie = name + “=”+ escape +
“;expires=” + exp.toGMTString();}

相关文章

网站地图xml地图