非常愚蠢的错误消息:未捕获的语法错误:意外的令牌;

Very dumb error message: Uncaught SyntaxError: Unexpected token ;

本文关键字:错误 语法 意外 令牌 消息 非常      更新时间:2023-09-26

我得到了一个非常愚蠢的错误mssage:

未捕获的语法错误:意外的令牌;

我看不出语法错误的地方:

$(document).ready(function() {
        var start = $.superscollorama();            
        start.addTween('#windSection', Tweenmax.from($('#windSection'), .25, {css:{backgroundColor:'blue'}});    
});

将所有内容放在一行上没有奖品:

$(document).ready(function() {
        var start = $.superscollorama();            
        start.addTween(
            '#windSection', 
            Tweenmax.from(
                $('#windSection'), 
                .25, 
                {
                    css:{
                        backgroundColor:'blue'
                    }
                }
            ) //missed this one
        );
});

因为您错过了第 3 行中的)

start.addTween(
  '#windSection',
  Tweenmax.from(
     $('#windSection'),
     .25,
     {
        css: {
          backgroundColor:'blue'
        }
     }
   )
); // <<<<
$(document).ready(function () {
        var start = $.superscollorama();
        start.addTween('#windSection', 
            Tweenmax.from($('#windSection'), 
                .25, 
                {
                    css: { backgroundColor: 'blue' }
                }
            );
        ); // this one
    });
相关文章: