这是我的方法:
$.validator.addMethod("password_verify_old", function(value, element){
$.ajax({
type: "GET",
url: verify_old_password_url,
data: {oldPassword: value},
dataType: "json",
success: function (msg) {
return eval(msg);
}
});
}, "Old password is incorrect.");
在这里,我调用我的控制器,它只返回一个“真”字符串。为什么 jquery.validate.js 将其解释为“假”?