这些js代码什么意思?哪位好心人,有标问号的给解释下吧
functionvalidationInfo(form){var$form=$(form),????result=$form.data(data_validation);...
function validationInfo(form) {
var $form = $(form), ????
result = $form.data(data_validation); ????
if (!result) {
result = {
options: { // options structure passed to jQuery Validate's validate() method
errorClass: "input-validation-error",
errorElement: "span",
errorPlacement: $.proxy(onError, form), ////这个是有对表单操作 错误时候执行的么?? 那么页面加载的时候呢???
invalidHandler: $.proxy(onErrors, form),
messages: {},
rules: {},
success: $.proxy(onSuccess, form)
},
attachValidation: function () {
$form.validate(this.options);
},
validate: function () { // a validation function that is called by unobtrusive Ajax
$form.validate();
return $form.valid();
}
};
$form.data(data_validation, result);
}
哪位好心人解释下啊?这个是js验证里面的写的 展开
var $form = $(form), ????
result = $form.data(data_validation); ????
if (!result) {
result = {
options: { // options structure passed to jQuery Validate's validate() method
errorClass: "input-validation-error",
errorElement: "span",
errorPlacement: $.proxy(onError, form), ////这个是有对表单操作 错误时候执行的么?? 那么页面加载的时候呢???
invalidHandler: $.proxy(onErrors, form),
messages: {},
rules: {},
success: $.proxy(onSuccess, form)
},
attachValidation: function () {
$form.validate(this.options);
},
validate: function () { // a validation function that is called by unobtrusive Ajax
$form.validate();
return $form.valid();
}
};
$form.data(data_validation, result);
}
哪位好心人解释下啊?这个是js验证里面的写的 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询