jquery 中的 return false 不起作用

时间:2021-11-17 11:26:42

jquery  中的 return false 不起作用

 $(".lcId").each(function(e) {
if ($(this).attr("checked") == "checked") {
if($(this).attr("name")==24){
ids.push($(this).val() + '');
}else{
alert("请选择待处理订单");
e.preventDefault();
return false ; //不起作用
}
}
});

将 return  false , 更改为 e.preventDefault(); 在e 该 function 中的参数

原文 来自  http://www.berlinix.com/js/jquery-return-false.php