需要帮助查找 jQuery 代码中的开括号

发布于 2024-12-31 21:56:58 字数 1027 浏览 0 评论 0原文

我想知道是否有人可以帮助我正确关闭代码。我尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼趣 2025-01-07 21:56:58

您的规则对象缺少右括号。

你有这个:

rules: {
ordernum2: {
required: true,
minlength: 12
}

应该是这样:

rules: {
  ordernum2: {
    required: true,
    minlength: 12
  }
}

Your rules object is missing it's closing bracket.

You have this:

rules: {
ordernum2: {
required: true,
minlength: 12
}

It should be this:

rules: {
  ordernum2: {
    required: true,
    minlength: 12
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文