Javascript - now with more fun! · 16 August 2008, 11:16

I have been doing some javascript development for web UIs for the first time in years and wow have things changed for the better.

Integrating Javascript into an application is now easier than ever, thanks to the large number of open source Javascript libraries available on the Internet. Each framework I have tried provides a nice, object-oriented API that includes visual effects, event libraries that allow a developer to add events to pages without mixing Javascript and HTML together, and helper routines to make DOM manipulation and parsing very very easy.

Jason Seifer gives a very good talk on separating web UI display and formatting from Javascript functionality. Integrating Javacsript into web UIs in this manner has been given the name “Unobtrusive Javascript.” If you have used any MVC-style frameworks you will easily pick up this technique and it really does separate HTML and Javascript in a very nice way.

The frameworks I have tried out so far are:

I like them all; so far I find the event API (which has been my focus lately) of jQuery and Moo Tools to be the nicest of the five.

All hide browser differences from the user, something that used to make simple tasks take hours and hours to implement properly.

Dojo and Moo Tools allow you to roll your own distribution of their tool from their web sites, which is a neat feature. Unfortunately a number of the Dojo examples would not work on my Firefox 3.0.1 browser, threw javascript errors, this is something I am sure they will fix in the near future.

All of the libraries offer “minified” and compressed versions of their libraries, of the list above I believe Moo Tools comes in at the smallest when uncompressed when downloading their full package.

— Max Schubert