本文共 1088 字,大约阅读时间需要 3 分钟。
一、有效方式
//扩展验证方法$.extend($.fn.validatebox.defaults.rules, { checkSignCode:{//检查验证码 validator: function (value) { var checkR=$.ajax({ async : false, cache : false, type : 'post', url : '../signcode/check', data : { 'signcode' : value } }).responseText; return checkR==="true"; }, message: '验证码错误' } });二、无效方式
//扩展验证方法$.extend($.fn.validatebox.defaults.rules, { checkSignCode:{//检查验证码 validator: function (value) { var checkR=false; $.ajax({ async : false, type : 'post', url : '../signcode/check', data : { 'signcode' : value }, success : function(result) { if (result === 'true') { checkR= true; } } }); return checkR; }, message: '验证码错误' }});
转载地址:http://szvmb.baihongyu.com/