Which JavaScript Framework?

Taking a look at this list of top 10 JavaScripts libraries, I'm curious as to what people are doing with JavaScript nowadays. We mostly focus on jQuery nowadays - it seems to have emerged as the defacto standard (Microsoft endorsing it certainly didn't hurt). The only component-based framework (at least on the Java side) that seems to have much traction is GWT. There is another promising framework called ZK, but it doesn't seem to have much mindshare. It's a little hard to compare, as both GWT and ZK really take over your web application, whereas jQuery is more of an add-on, but they do reflect two fundamentally different views of web development. jQuery comes from the HTML+CSS+jQuery model, whereas GWT and ZK both subscribe to a highly integrated browser and server.

Here's my basic checklist for deciding which approach to take:

jQuery+HTML+CSS wins if...

  • You care about SEO
  • You want to support browsers with JavaScript turned off
  • Your application is primarily oriented toward HTML design & content
  • You want a very high degree of support for browser-specific extensions, and you want to spend the time testing and supporting those extensions yourself
  • You mainly have a background in web development and want to add "a little bit of interactivity or Ajax"

GWT or ZK wins if...

  • Your application is based on a desktop metaphor
  • The bulk of your application is based on frequent updates between the client and server in lots of places in the UI
  • You don't care about supporting browsers without JavaScript or SEO
  • You are ok with the mobile support provided by the respective framework
  • You mainly have a background in server-side development and really hate the idea of dealing with all the different browsers (you just want a framework that abstracts that away).
  • You don't plan on building a lot of custom components - the ones the frameworks come with look pretty good to you.

Now, you can actually make any framework work. For example, ZK has support for SEO. jQuery can be used as the basis for a desktop metaphor application. Other frameworks of interest include the following HTML+CSS+JavaScript tools:

Other component-based frameworks include:

Honorable mention also goes to DWR, for integrating browser-side JavaScript and server-side Java.