Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check client-side JavaScript code for syntax errors? [closed]

I have some client-side JavaScript code and want to check that file for syntax errors/warnings.

What is the easiest way to check my JavaScript file for "compile time" errors, such as a mismatched bracket or a keyword typo?

like image 366
Steven Hammons Avatar asked Mar 11 '11 22:03

Steven Hammons


2 Answers

Copy and paste it into http://www.jslint.com/ but be prepared to "have your feelings hurt".

like image 180
Shaggy Frog Avatar answered Oct 24 '22 13:10

Shaggy Frog


Opening your JavaScript console in the Chrome browser with (Tools->JavaScript console) or (CTRL + SHIFT + J) is always a good place to start. However, JSLint is really your best bet.

like image 24
Yottagray Avatar answered Oct 24 '22 13:10

Yottagray