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

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

问题描述

我正在编写一段JavaScript代码,并在语法中犯下大量愚蠢的错误.但是查找错误所在行的唯一方法是开始注释掉我刚刚编写的代码部分,然后将其重新加载到浏览器中以缩小丢失的');'的位置.是.

I am writing a JavaScript section of code and 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 (如果您不这样做)直到运行时才发现错误.当然,萤火虫的效果更好,但这是一种快速的方法.

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天全站免登陆