日期:2014-05-16  浏览次数:20328 次

this.optional(element) 代表什么
jQuery.validator.addMethod("domain", function(value, element) { 
  return this.optional(element) || /^http:\/\/mycorporatedomain.com/.test(value); 
}, "Please specify the correct domain for your documents");

this.optional(element) 代表什么
------解决方案--------------------
optional方法,用于表单位素值是否为空。