我尝试了这段代码

并得到了SyntaxError: missing ) after argument list

有没有更好的调试器来显示Mac上更易理解且更准确的错误?

jQuery(document).ready(
    $('.fancy .slot').jSlots({
        number : 2,
        winnerNumber : 1,
        spinner : '#playFancy',
        easing : 'easeOutSine',
        time : 7000,
        loops : 6,
        onStart : function() {
            $('.slot').removeClass('winner');
        },
        onWin : function(winCount, winners) {
            // only fires if you win

            $.each(winners, function() {
                this.addClass('winner');
            });

            // react to the # of winning slots
            if ( winCount === 1 ) {
                alert('You got ' + winCount + ' 7!!!');
            }
            else if ( winCount > 1 ) {
                alert('You got ' + winCount + ' 7’s!!!');
            }

        }
    });
);

最佳答案

您缺少function关键字:

jQuery(document).ready(function (){
    // code here
});

关于javascript - 我在参数列表后找不到SyntaxError:缺少)怎么了,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23925024/

10-09 07:37