在callback函数中返回false就可以调出循环了,如果要continue的话,返回非false就行,例子如下
var recordlen = 0;
$("#classname").each(function(index){
if($(this).attr("state")=="going"){
alert("不能删除正在处理的记录");
return false;//相当于break;
}
recordlen ++;
});
网友回复
在callback函数中返回false就可以调出循环了,如果要continue的话,返回非false就行,例子如下
var recordlen = 0;
$("#classname").each(function(index){
if($(this).attr("state")=="going"){
alert("不能删除正在处理的记录");
return false;//相当于break;
}
recordlen ++;
});
网友回复