jQuery Validate ajax not working for Captcha check
问题 This is my code: $.validator.addMethod('checkCaptcha', function(value) { $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: baseURI + '/ajax-process/?rand=' + new Date().getTime(), async: true, cache: false, dataType: "json", data: 'controller=validate_captcha&c_value=' + value, success: function (jsonData) { console.log(jsonData.check_result) // It return true. if (jsonData.check_result) { return true; } reuturn false; }, error: function (XMLHttpRequest, textStatus,