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
jQuery Uncaught SyntaxError: Unexpected Identifier but my code looks good! (I think)
提问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.ready
just before that line.
您需要document.ready
在该行之前关闭您的。
document.ready(function(){
...
} <-- missing )
other stuff