gpt4 book ai didi

jquery - Codekit Uglify.js 'Unexpected token punc' 错误

转载 作者:行者123 更新时间:2023-12-01 04:13:28 28 4
gpt4 key购买 nike

我不确定我的语法/意外标记错误在哪里

我在 jsfiddle 上的完整 jQuery 函数: http://jsfiddle.net/leongaban/gmRUa/


我收到的错误:

The following error information applies to that file: 

'Unexpected token punc, expected punc',
line: 160,
col: 29,
pos: 5212,

enter image description here

对应于 my jsfiddle 的第 30 行带有 } catch {

的行

您注意到导致错误的原因了吗?



功能:

//REGISTER
var wireRegisterForm = function (form) {

console.log('inside wireRegisterForm');
var $form = $(form);

//form being submitted
$form.find('button').unbind('click').bind('click', function () {
if (WORLD.validation.validateRegisterForm($form)) {

var params = {
"email":$form.find('#register-email').val(),
"firstName":$form.find('#register-firstname').val(),
"lastName":$form.find('#register-lastname').val(),
"password":$form.find('#register-password').val()
};

//fill params with parameters from form
WORLD.networking.postToServerWithAjax('/login', params, function (response) {

//check successful or not from response object
try {
var isSuccessful = response.wassuccessful;
if (isSuccessful === true) {
loginSuccess();
} else {
// login failed
}
} catch {
// login failed
}

});

}

//stop the form submit
return false;
});

//enter clicked from password box
$form.find("input[name='password']").unbind('keyup').bind('keyup', function (event) {
if (event.keyCode === 13) {
this.find("button").click();
}
});
};

最佳答案

错误是我的 catch 语句错误...这是编写 javascript catch 的正确方法:

catch(err)

关于jquery - Codekit Uglify.js 'Unexpected token punc' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17328998/

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