需要帮助查找 jQuery 代码中的开括号
我想知道是否有人可以帮助我正确关闭代码。我尝试在 jsFiddle 和页面上关闭它,但在某个地方我正在执行 }
或 )
或 ;
的任务之一,
这是下面的代码感谢帮助:
// validate form and submit
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j("#myform").validate({
rules: {
ordernum2: {
required: true,
minlength: 12
},
messages: {
ordernum2: {
required: "Please a enter post code",
minlength: "Must be at least 12 digits"
}},
var url = "mypage.php";
var params = "id_order="+$j("#ordernum1").val();
$j.ajax({
type: 'POST',
url: url,
dataType: 'html',
data: params,
cache: false,
beforeSend: function() {
$j('#workflow-column-3').html('<div style="background-position:center; background-image:url(../img/css/contact/spinner40.gif); background-repeat:no-repeat; padding: 25px 50px 50px 50px; height:100px"></div>');
},
complete: function() {
return false;
},
success: function(data) {
$j('#serial-required').hide(),
$j('#workflow-column-3').show(),
$j('#workflow-column-3').html(data);
}
});
};
});
});
I was wondering if some one could help me close the code correctly. I have tried to close it in jsFiddle and on the page but somewhere I am mission one of }
or )
or ;
Here is the code below and help is appreciated:
// validate form and submit
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j("#myform").validate({
rules: {
ordernum2: {
required: true,
minlength: 12
},
messages: {
ordernum2: {
required: "Please a enter post code",
minlength: "Must be at least 12 digits"
}},
var url = "mypage.php";
var params = "id_order="+$j("#ordernum1").val();
$j.ajax({
type: 'POST',
url: url,
dataType: 'html',
data: params,
cache: false,
beforeSend: function() {
$j('#workflow-column-3').html('<div style="background-position:center; background-image:url(../img/css/contact/spinner40.gif); background-repeat:no-repeat; padding: 25px 50px 50px 50px; height:100px"></div>');
},
complete: function() {
return false;
},
success: function(data) {
$j('#serial-required').hide(),
$j('#workflow-column-3').show(),
$j('#workflow-column-3').html(data);
}
});
};
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的规则对象缺少右括号。
你有这个:
应该是这样:
Your rules object is missing it's closing bracket.
You have this:
It should be this: