初学Javascript之cookie篇(译)
时间:2007-10-22 来源:不详 作者:林子
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name "=" escape (value)
((expires == null) ? "" : ("; expires=" expires.toGMTString()))
((path == null) ? "" : ("; path=" path))
((domain == null) ? "" : ("; domain=" domain))
((secure == true) ? "; secure" : "");
}
function setLastlastVisitCookie ()
{
var rightNow = new Date();
var expdate = new Date();
expdate.setTime (expdate.getTime() 1 * (24 * 60 * 60 * 1000)); // 1 day
SetCookie ("lastVisit", rightNow.getTime(), expdate, "/");
}
function ResetCookie()
{
SetCookie("lastVisit", 0, null, "/");
}
// -->
</script>
</body>
</html>
本文来自织梦
本文来自织梦
dedecms.com
文章评论
共有位Admini5网友发表了评论 查看完整内容