var mycookie = document.cookie;
var username='username';
var start1 = mycookie.indexOf(username+ "=");
if(start1!= -1){
start=mycookie.indexOf("=",start1)+1;
var end = mycookie.indexOf(";",start);
if(end==-1){
end=mycookie.length;
}
var value=unescape(mycookie.substring(start,end));
}
js 取 cookie
最新推荐文章于 2022-04-11 16:04:51 发布