views:

42

answers:

4

how to scan javascript code to find errors (are there any programs do that) ?

+2  A: 

Load it into Firefox, and use Firebug plugin. It enables you to debug JavaScript, and to see where errors are located in your code.

Guillaume Lebourgeois
+3  A: 

Try JSLint

Shay Erlichmen
JSLint will hurt your feelings :)
Daniel Vassallo
@Daniel Vassallo: Whereas some browsers will hurt your feelings by passively-aggresively gobbling up error messages and then being deliberately unhelpful. "Object expected on line 0", know what I mean? ;)
Piskvor
@Piskvor: So true :)
Daniel Vassallo
A: 

You can use JSLint, and of course Firebug

Dani Cricco
A: 

Yes, a number of programs have plugins etc that can be used to detect common errors and syntax problems.

If I were you I would start here, JS Lint or here

In addition, each most browsers have a Javascript console where you can see errors reported and debug your code. Safari and Chrome have it in-built, for Firefox download Firebug.

michael