Are there any JavaScript editors that can validate JavaScript syntax on the fly? Things like missing brackets, etc.

+1  A: 

I recommend Visual Web Developer Express 2010.

+3  A: 

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

Jamie Wong
Love it, but it's not an IDE :P
+1  A: 

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.

Sam Hanes
[Aptana Studio](http://www.aptana.com/) is built on Eclipse and is aimed at generic web, rails and Adobe Air development. I'm personally not partial to Eclipse, but Aptana works pretty well.
+3  A: 

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.flymake with spidermonkey

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.

IntelliJ's javascript syntax checking

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 netbean's javascript syntax highlighting

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.

@fmark, how long did it take you to configure emacs to work the way you wanted it?
@Andrew About half an hour :(
@fmark, that's actually a lot better than I was expecting. If I could pull that off, I'd consider it a resounding success. I will try this out.
I also found this helpful: http://mnemonikk.org/2008/05/06/live-syntax-checking-javascript-with-emacs/
IntelliJ IDEA's excellent JavaScript support is also present in RubyMine and PhpStorm and WebStorm.
Tim Down

Eclipse (or it's web specialized form Aptana) and Netbeans offer syntax checking on the fly.