js对cookie的几个操作函数,网上找的(仅作备忘)
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;
var j = 0;
while (i < clen) {
j = i + alen;
if ...