javascript jQuery Uncaught SyntaxError: Unexpected Identifier 但我的代码看起来不错!(我认为)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6165706/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 19:42:45  来源:igfitidea点击:

jQuery Uncaught SyntaxError: Unexpected Identifier but my code looks good! (I think)

javascriptjquerysyntax

提问by trusktr

If you look at this exampleyou'll see that I get this error on line 265 (when you inspect element).

如果您查看此示例,您会看到我在第 265 行(当您检查元素时)收到此错误。

I've split the error line into multiple parts so you can see exactly where the error occurs.

我已将错误行拆分为多个部分,以便您可以准确查看错误发生的位置。

Why might it be happening?

为什么会发生?

回答by James Montagne

You need to close your document.readyjust before that line.

您需要document.ready在该行之前关闭您的。

document.ready(function(){

...


}  <-- missing )

other stuff