function cookie(name) {
var cookieArray = document.cookie.split("; "); // 得到分割的cookie名值对
var cookie = new Object();
for ( var i = 0; i < cookieArray.length; i++) {
var arr = cookieArray[i].split("="); // 将名和值分开
if (arr[0] == name)
return unescape(arr[1]); // 如果是指定的cookie,则返回它的值
}
return "";
}
function delCookie(name)// 删除cookie
{
document.cookie = name + "=;expires=" + (new Date(0)).toGMTString();
}
function SetCookie(name, value)// 两个参数,一个是cookie的名子,一个是值
{
var Days = 30; // 此 cookie 将被保存 30 天
var exp = new Date(); // new Date("December 31, 9998");
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
document.cookie = name + "=" + escape(value) + ";expires="
+ exp.toGMTString();
}
1.判断checkebox 被选中的有几个$("input:checkbox[name=checkbox]:checked").length2.cookiefunction cookie(name) { var cookieArray = document.cookie.split("; "); // 得到分割的cookie名值对 var cookie = new Ob