答案 0 :(得分:3)
你有一个额外的分号。如果您使用“jshint”按钮,您将看到错误。
$(function () {
// Setup form validation on the #register-form element
$("#register").validate({
errorElement: "div",
rules: {
// Specify the validation rules
email: {
required: true,
email: true,
minlength: 4
},
// Specify the validation error messages
messages: {
email: "Please enter a valid email address"
},
submitHandler: function (form) {
form.submit();
}
} //REMOVED SEMICOLON HERE
});
});