4

所以我不断收到错误:

employeesScript.js:3Uncaught SyntaxError: Unexpected token {.

它让我发疯,因为我无法弄清楚是什么原因造成的。我还通过 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

这是我的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;
});

});
4

1 回答 1

11

fuction拼写错误。它应该function在第 3 行。

于 2012-04-28T04:43:29.157 回答