发布网友 发布时间:2022-04-22 05:03
共1个回答
热心网友 时间:2022-05-16 09:09
存:
document.cookie = "name=Kevin;expires="+new Date().getDate()+7; //有效期7天
取:
function GetCookie(sName)
{
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}
return null;
}
GetCookie('name') //Kevin