简体   繁体   English

未捕获的SyntaxError:意外的令牌)

[英]Uncaught SyntaxError: Unexpected token )

im getting this weird message its really awful. 我得到这个奇怪的消息真的很糟糕。 Here you can see a fiddle, 在这里你可以看到一个小提琴,

http://jsfiddle.net/xHL35/8/ http://jsfiddle.net/xHL35/8/

Or you can paste the next code into an html , 或者你可以将下一个代码粘贴到html中,

if is it a syntax mistake why it dosent tell me the line where the error is?? 如果它是一个语法错误,为什么它告诉我错误的行?

Also every time i clic next (When the overlay is open) the error comes again so after 5 clics, i have 5 errors on console. 此外,每次我clic next(当覆盖打开时)错误再次出现,所以在5个clics之后,我在控制台上有5个错误。

Thanks 谢谢

 <div id="navpics"><a href="javascript:();" class="prevImg">NEXT</a><div id="imageCounter"></div><a href="javascript:();" class="nextImg">PREV</a></div>
<a href="javascript:();" class="nextImg">NEXT</a>

It does not like the (); 它不喜欢();

If you insist on using the anchor like that use void(0) 如果你坚持使用这样的锚使用void(0)

<a href="javascript:void(0);" class="nextImg">NEXT</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM