简体   繁体   English

如何检查javascript语法错误

[英]how to check javascript syntax error

Firebug looks not capable to check js syntax error... Firebug似乎无法检查js语法错误...

Is there any good way to do that? 有什么好办法吗?

Currently I just wrote a js but the firebug didn't show any error but the functionality is totally broken. 目前,我只是写了一个js,但萤火虫没有显示任何错误,但功能已被破坏。

Firebug does do it. Firebug做到了。 Make sure that you have JavaScript Console enabled, you can do so by clicking the Console dropdown and from their select Enabled . 确保已启用JavaScript控制台,可以通过单击控制台下拉菜单并从其选择启用来启用 You need to press F12 key to open firebug and once you refresh the page, you will see any errors you have in your script in the firebug js console. 您需要按F12键打开firebug,刷新页面后,您将在firebug js控制台中看到脚本中的任何错误。

If you are using Firefox, you can also press Contr+Shift+J to open firefox's error dialog. 如果您使用的是Firefox,还可以按Contr + Shift + J打开Firefox的错误对话框。

are you sure Firebug is turned on? 您确定Firebug已打开? If it's on, the little bug in the lower right is colored brown. 如果亮起,则右下角的小虫会变成棕色。 if it's not on, the bug is gray. 如果未打开,则该错误为灰色。

also, I find that Web Inspector in Safari/Chrome is better. 另外,我发现Safari / Chrome中的Web Inspector更好。

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

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