1

这个右括号怎么出乎意料

function pollCreateOptions_addOption ()
{ // Opening of curly bracket 1
    var highestN = 0;

    $('table#options tr td fieldset').each
    ( // Opening of normal bracket 1
        function (i, option)
        { // Opening of curly bracket 2
            alert (this.attr ('name'));
        { // Closing of curly bracket 2
    ); // Closing of normal bracket 1
} // Closing of curly bracket 1
4

2 回答 2

1
$('table#options tr td fieldset').each
    ( 
        function (i, option)
        { 
            alert (this.attr ('name'));

        } // not {
    );
于 2012-06-02T14:32:43.730 回答
1

你应该在这里使用关闭}而不是打开{{ // Closing of curly bracket 2

function pollCreateOptions_addOption ()
{ // Opening of curly bracket 1
    var highestN = 0;

    $('table#options tr td fieldset').each
    ( // Opening of normal bracket 1
        function (i, option)
        { // Opening of curly bracket 2
            alert (this.attr ('name'));
        } // Closing of curly bracket 2
    ); // Closing of normal bracket 1
} // Closing of curly bracket 1
于 2012-06-02T14:32:57.083 回答