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

查看:17
本文介绍了如何查找 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 in firefox,如果你不这样做直到运行时才发现您的错误.当然,firebug 效果更好,但这是一个快速的方法.

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