var Cookie={
get:function(name){
var value='',matchs;
if(matchs=document.cookie.match("(?:^| )"+name+"(?:(?:=([^;]*))|;|$)"))
value=matchs[1]?unescape(matchs[1]):"";
return value
},
set:function(name,value,expire,domain){
expire=expire||30*24*3600*1000;
var date=new Date(),cookie="";
date.setTime(date.getTime()+expire);
cookie=name+"="+escape(value)+";expires="+date.toGMTString()+";path=/;";
domain&&(cookie+="domain="+domain+";");
document.cookie=cookie
},
del:function(name,domain){
Cookie.set(name,'',-1,domain)
}
};
js 操作 cookie
最新推荐文章于 2024-12-08 07:08:42 发布
905

被折叠的 条评论
为什么被折叠?



