简体   繁体   English

感到困惑的是} jquery错误

[英]Baffled by } jquery error

so I keep getting the error: 所以我一直收到错误:

employeesScript.js:3Uncaught SyntaxError: Unexpected token {. employeesScript.js:3Uncaught SyntaxError:意外的令牌{。

It is driving me nuts because I can't figure out what is causing it. 它让我疯狂,因为我无法弄清楚是什么导致它。 I also ran it through JSFiddle and got the following error: 我也通过JSFiddle运行它并得到以下错误:

Error:
Problem at line 3 character 50: Expected ')' and instead saw '{'.
$(".employeesPostHours").live("click", fuction() {

Problem at line 3 character 51: Missing semicolon.
$(".employeesPostHours").live("click", fuction() {

Problem at line 45 character 1: Expected '(end)' and instead saw '}'.
});

Implied global: $ 1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20, fuction 3, employeeEntry 5,6,7,8,9,10,11,12,13, employeesId 6,23, employeesEmail 7,24, employeesStartTime 8,25, employeesEndTime 9,26, employeesDate 10,27, employeesExtraMoney 11,28, employeesExtraMoneyDetail 12,29, driving 13,30, onTruck 14,31, warehouse 15,32, phones 16,33, flyering 17,34, wageChange 18,35, alert 38

Here is my Jquery: 这是我的Jquery:

$(document).ready(function(){

$(".employeesPostHours").live("click", fuction() {
$("#employeesSection1Form").append("Please Wait...");
employeeEntry = $(this).closest("div");
employeesId = $(employeeEntry).find("#employeesId").val();
employeesEmail = $(employeeEntry).find("#employeesEmail").val();
employeesStartTime = $(employeeEntry).find("#employeesStartTime").val();
employeesEndTime = $(employeeEntry).find("#employeesEndTime").val();
employeesDate = $(employeeEntry).find("#employeesDate").val();
employeesExtraMoney = $(employeeEntry).find("#employeesExtraMoney").val();
employeesExtraMoneyDetail = $(employeeEntry).find("#employeesExtraMoneyDetail").val();
driving = $(employeeEntry).find("#driving").val();
onTruck = $(onTruck).find("#onTruck").val();
warehouse = $(warehouse).find("#warehouse").val();
phones = $(phones).find("#phones").val();
flyering = $(flyering).find("#flyering").val();
wageChange = $(wageChange).find("#wageChange").val();

$.post(
            'employeesHoursPost.php', 
            {
                'employeesId': employeesId,
                'employeesEmail': employeesEmail,
                'employeesStartTime': employeesStartTime,
                'employeesEndTime': employeesEndTime,
                'employeesDate': employeesDate,
                'employeesExtraMoney': employeesExtraMoney,
                'employeesExtraMoneyDetail': employeesExtraMoneyDetail,
                'driving': driving,
                'onTruck': onTruck,
                'warehouse': warehouse,
                'phones': phones,
                'flyering': flyering,
                'wageChange': wageChange
            },
            function (response) {
            alert (response);
            }
);
return false;
});

});

fuction is misspelled. fuction拼写错误。 It should be function on line 3. 它应该是第3行的function

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM