function batchdel() {//批量删除
var chk_value =[];
$('input[name="ids"]:checked').each(function(){
chk_value.push($(this).val());
});
if (chk_value.length==0) {
alert("请选择学号!");
return false;
}
if (chk_value.length > 0) {
var msg = '确认删除' + chk_value + '吗?';
if (confirm(msg) == true) {
location.href = "<%=basePath%>user/batchDelete?chk_value=" + chk_value;
return true;
} else {
return false;
}
}
}
var checkedIds=""; //翻页保存选中的id
function changeIds(){
var oneches=document.getElementsByName("ids");
for(var i=0;i<oneches.length;i++){
if(oneches[i].checked==true){
if(!contains(checkedIds,oneches[i].value)){
checkedIds+=oneches[i].value+",";
}
}
if(oneches[i].checked==false){
if(contains(checkedIds,oneches[i].value)){
checkedIds=checkedIds.replace((oneches[i].value+","),"");
}
}
}
}
function getChecked(){
if(checkedIds==""){
return;
}
var oneches=document.getElementsByName("ids");
for(var i=0;i<oneches.length;i++){
if(contains(checkedIds,oneches[i].value)){
oneches[i].checked="checked";
}
}
}
function contains(obj, ele) {
if(obj==""){
return;
}
var arr = obj.split(",");
var i = arr.length;
while (i--) {
if (arr[i] == ele) {
return true;
}
}
return false;
}
<a href="list?pageIndex=${pageUtil.pageIndex<pageUtil.pageCount?pageUtil.pageIndex+1:pageUtil.pageCount}" class='next' onclick="changeIds();getChecked();contains(this,obj,ele);">下一页</a>

changeIds
这方法调用了?oneches[i].value
log一下 看看有值么?