Jquery Codekit Uglify.js';意外标记punc';错误
我不确定我的语法/意外标记错误在哪里 我在JSFIDLE上的完整jQuery函数:Jquery Codekit Uglify.js';意外标记punc';错误,jquery,syntax-error,uglifyjs,codekit,Jquery,Syntax Error,Uglifyjs,Codekit,我不确定我的语法/意外标记错误在哪里 我在JSFIDLE上的完整jQuery函数: 我得到的错误是: The following error information applies to that file: 'Unexpected token punc, expected punc', line: 160, col: 29, pos: 5212, 它对应于带有catch{ 您注意到错误的原因了吗? 职能: //REGISTER var wireRegisterForm
我得到的错误是:
The following error information applies to that file:
'Unexpected token punc, expected punc',
line: 160,
col: 29,
pos: 5212,
它对应于带有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(err)