gpt4 book ai didi

javascript - SyntaxError 结束参数列表的意外标记

转载 作者:行者123 更新时间:2023-12-02 16:01:10 30 4
gpt4 key购买 nike

我有以下 JS 代码:

$('#form_step_2').validate({
customer_credit_card_number: {
required: true,
creditcard: true
},
customer_credit_card_expiration_month: {
required: true,
range: [1, 12]
},
customer_credit_card_expiration_year: {
required: true,
range: [new Date().getFullYear()+1, new Date().getFullYear()+16]
},
customer_credit_card_security_number: {
required: true,
minlength: 3,
maxlength: 4
}
},
submitHandler: function(form) {
alert('Success');
}
});

除了错误之外,一切看起来都正常:

SyntaxError: Unexpected token ':'. Expected ')' to end a argument list.

我认为错误就在这一行

submitHandler: function(form) {

但是当我查看documentation时我使用的 jQuery 验证插件,它看起来是正确的。

请问有什么帮助吗?

最佳答案

你那里有一个额外的闭合护腕,编辑如下:

$('#form_step_2').validate({
customer_credit_card_number: {
required: true,
creditcard: true
},
customer_credit_card_expiration_month: {
required: true,
range: [1, 12]
},
customer_credit_card_expiration_year: {
required: true,
range: [new Date().getFullYear() + 1, new Date().getFullYear() + 16]
},
customer_credit_card_security_number: {
required: true,
minlength: 3,
maxlength: 4
},
submitHandler: function (form) {
alert('Success');
}
});

关于javascript - SyntaxError 结束参数列表的意外标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31188238/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com