把checkbox选定的值放在JS cookie里,当翻页的再读取cookie,再继续加checkbox选定的值 知道需要使用这些值为之; value = getCookie(cookieName); var offerIds = stringToArray(value); var len = offerIds.length; var result = ""; var counter = 0; for(var i=0;i<len;i++) { if(offerIds[i] != arg) { if(counter == 0) { result = offerIds[i]; } else { result = result + "x" + offerIds[i]; } counter++; } } cookieValue = cookieName + "=" + result document.cookie = cookieValue;
知道需要使用这些值为之;
value = getCookie(cookieName);
var offerIds = stringToArray(value);
var len = offerIds.length;
var result = "";
var counter = 0;
for(var i=0;i<len;i++) {
if(offerIds[i] != arg) {
if(counter == 0) {
result = offerIds[i];
} else {
result = result + "x" + offerIds[i];
}
counter++;
}
}
cookieValue = cookieName + "=" + result
document.cookie = cookieValue;