Jquery 如何从对象调用函数?
我使用formValidation编写登录表单验证。现在我想在脚本中调用这个函数。如何调用form_登录函数Jquery 如何从对象调用函数?,jquery,formvalidation-plugin,Jquery,Formvalidation Plugin,我使用formValidation编写登录表单验证。现在我想在脚本中调用这个函数。如何调用form_登录函数 (function(){ $.fn.validation = { form_login: function(form){ $(form).formValidation({ icon: { valid: 'fa fa-check', invalid:
(function(){
$.fn.validation = {
form_login: function(form){
$(form).formValidation({
icon: {
valid: 'fa fa-check',
invalid: 'fa fa-remove',
validating: 'fa fa-refresh'
},
fields: {
usernme: {
validators: {
notEmpty: {},
}
},
password: {
validators: {
notEmpty: {},
}
},
captcha: {
validators: {
notEmpty: {},
}
}
}
});
},
};
}());
代码更短的类似内容的用法示例:
$.fn.test={
test_method: function(){alert('a');}
}
var div= "<div></div>";
$(div).test.test_method(); // it will output that alert