展开全部
试下下面这段 JS代码
============ 华丽的分割线 =================
function addCookie(objName,objValue,objHours)
{
var str = objName + "=" + escape(objValue);
if(objHours > 0){ //等于0时,关闭浏览器自动清除Cookies.
var date = new Date();
var ms = objHours*3600*1000;
date.setTime(date.getTime() + ms);
str += "; expires=" + date.toGMTString();
}
document.cookie = str;
}
============== The End ====================
============ 华丽的分割线 =================
function addCookie(objName,objValue,objHours)
{
var str = objName + "=" + escape(objValue);
if(objHours > 0){ //等于0时,关闭浏览器自动清除Cookies.
var date = new Date();
var ms = objHours*3600*1000;
date.setTime(date.getTime() + ms);
str += "; expires=" + date.toGMTString();
}
document.cookie = str;
}
============== The End ====================
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询