Are there any JavaScript editors that can validate JavaScript syntax on the fly? Things like missing brackets, etc.
You can go grab Javascript Lint then do exactly what you want and use whatever editor you want:
Javascript Lint - http://www.javascriptlint.com/download.htm
I use Komodo Edit from Activestate. It validates, has code completion, brace matching, etc., and not just for Javascript.
Edit: BTW I have a macro in Komodo Edit that calls JS_Beautify and does a spectacular job.
Here is another idea of validating your .js with c# in VS http://madskristensen.net/post/Verify-JavaScript-syntax-using-C.aspx
If you use Eclipse, the JSDT project provides a JavaScript nature. Like most of Eclipse's language natures, it provides a context engine with realtime validation, syntax highlighting, completion, etc.
Personally, I like to use emacs
with flymake
, which can use Spidermonkey
, JsLint
or Rhino
to do the validation. This does the sort of on the fly syntax checking I think you are after. If you want a liberal validation, you might want to use Spidermonkey
as it is the execution engine from firefox, so it will reject anything firefox rejects. If you want something a little stricter, Crockford's JsLint
enforces good style.
Emacs is not for everyone however. If you prefer something point-and-click, you might want to check out IntelliJ's IDEA
. It can do on the fly syntax checking, along with a raft of other features. Sadly, javascript support is not available in the free version.
A free alternative to IntelliJ is Netbeans
, which purports to offer the same javascript functionality baked into the core. I don't have experience with it, but it is free, open source, and reputedly improving in recent versions
If you're a Windows or ASP.NET type developer you might be more interested in Microsoft Visual Web Developer Express 2010. It supports this features, and probably has better support for ASP.NET development than the other tools I've mentioned.
Eclipse (or it's web specialized form Aptana) and Netbeans offer syntax checking on the fly.