如何查找Javascript语法错误 [英] How to find Javascript syntax errors

查看:137
本文介绍了如何查找Javascript语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写代码的JavaScript部分,并且在语法中犯了很多愚蠢的错误。但找到错误行的唯一方法是开始注释掉我刚编写的代码部分,然后将其重新加载到浏览器中以缩小我失踪的');'是的。

I am writing a JavaScript section of code and am making huge amounts of silly mistakes in the syntax. But the only way to find what line the error is on is to start commenting out the section of code I just wrote and reload it into the browser to narrow down where my missing ');' is.

如何编译JavaScript源以确保它在语法上是正确的,以便我可以在浏览器中调试它?

How do you "compile" a JavaScript source to make sure it is syntactically correct so that I can debug it in the browser?

推荐答案

Ctrl + Shift + J 在firefox中,如果你没有抓住你的错误直到运行时。当然,萤火虫效果更好,但这是一种快速的方式。

Ctrl + Shift + J in firefox, if you don't catch your mistakes until runtime. Of course firebug works better, but this is a quick way.

这篇关于如何查找Javascript语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆