2012-06-02 49 views
1

`未捕获的SyntaxError:意外的标记)`根据Chrome的控制台

这是怎么结束括号意外

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 
+1

可能要检查你的眼镜片处方:-) – Pointy

+0

@Pointy你觉得这些眼镜就足够了? http://www.gravatar.com/avatar/98a392c9a0a6d6f15dc815d8c8dd8778?s=256&d=identicon&r=PG也许我应该考虑在脚本编写时将望远镜安装在我的头上:p – RobinJ

+0

Upvoted你的问题,因为我以前去过那里,我是当然,这不是我去过的最后一次! – froggythefrog

回答

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

     } // not { 
    ); 
+0

Noes认真吗? ><半小时搜索,这是问题所在? -.- – RobinJ

+1

@RobinJ有时它发生,没有事实伙伴,继续 – thecodeparadox

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 
相关问题