-2

我在 firebug 控制台中收到此错误,不知道如何修复它。我确定这是一些括号问题,但不知道如何纠正它。有人可以指出我的代码中的错误吗?谢谢

$(function ()
{

    $.validator.setDefaults(
    {
        errorClass: 'form_error',
        errorElement: 'div'
    });

    $("#frmreport").validate(
    {
        rules:
        {

            dept:
            {
                required: true
            },
            email:
            {
                required: true
            },
            position:
            {
                required: true
            },
            feedback:
            {
                required: true
            }
        },
        messages:
        {

            dept:
            {
                required: "<br />* required: You must select a department"
            },
            email:
            {
                required: "<br />* required: You must select a customer address"
            },
            position:
            {
                required: "<br />* required: You must select a service level"
            },
            feedback:
            {
                required: "<br />* required: You must enter a box number for intake"
            }
        },

        submitHandler: function()
        {
            if ($("#frmreport").valid() === true)
            { 
                var data = $("#frmreport").serialize();
                $.post'/sample/admin/frm10010.php', data, function(msg)
                {

                    var messageOutput = '';
                    for (var i = 0; i<msg.length; i++)
                    {
                        messageOutput += msg[i].box+'  ';     
                    }
                    $("#confirm_department").hide();

                    var $dialog = $('<div id="dialog"></div>').html('Your report was successfully submitted and a representative will respond to you shortly.<br /><br />Thank you.');
                    $dialog.dialog({
                        autoOpen: true,
                        modal: true,
                        title: 'Report submission successfull',
                        width: 400,
                        height: 200,
                        draggable: false,
                        resizable: false,
                        buttons: {
                            Close: function()
                            {
                                $( this ).dialog( "close" );
                            }
                        }
                   });

                $("#frmreport").get(0).reset();
                }, 'json'); **<--- error is here**

             }
             else
             { 
                 return; 
             }
        },
        success: function(msg)
        {
                //$("#BA_addbox").html("You have entered a box");
                //$("#BA_boxform").get(0).reset();
        }   

    });
}); 
4

1 回答 1

7
 $.post '/sample/admin/frm10010.php', data,

       ^----   Missing an opening brace

应该是

 $.post( '/sample/admin/frm10010.php', data,
于 2013-07-08T19:47:25.333 回答