JSLint
This script takes a JavaScript source, scans it, and returns a message describing any problems and their approximate location within the source. It looks at some style conventions as well as structural problems. It does not prove that your script is correct, it just provides another set of eyes to help spot problems.
Read more here
edit: Programming/Javascript/auto___jslint.wikieditish...