Where are we coming from
Looking at the core functionality of todays frameworks what do we have?
- DOM Traversal with CSS selectors to locate elements
- DOM Modification: Create/remove/modify elements
- Short syntax for adding/removing Events
- Short syntax for Ajax Request
- Animations (hide/show/toggle) & Transition
- User Interface Widgets (Drag & drop, Tree, Grid, Datepicker, Model Dialog, Menu / Toolbar, Slider, Tabbed Pane)
- Wide Browser Support
On the net you will find a mirrad of comparisons of popular frameworks. The most popular OpenSource and free JS Frameworks available today are:
* Prototype (&Scriptaculous for UI)
I would say that all of those have their advantages and drawbacks and there’s not really an obvious winner. It really depends on what you use it for. Some helpful links that helped me choosing are:
- Drop in a “calendar widget” or “tabbed navigation”
- Just customize some options and go.
- No flexibility.
Some Assembly Required
- Write common utilities
- Click a link, load a page via Ajax
- Build a dynamic menu
- Creating interactive forms
- Use pre-made code to distance yourself from browser bugs.
- Flexible, until you hit a browser bug.
- Deal, directly, with browser bugs
- Quirksmode is your lifeline
- Excessively flexible, to the point of hinderance.
=> Raw Java Script
Of course you can also mix different approaches, as you can also mix Frameworks but of course in terms of maintainability and productivity it would better if you don’t have to.
For my personal use case I had the following requirements:
- Easy to learn with minimal intuitive syntax
- Lightweight solution
- Availability of some widgets: Datepicker, Grid, maybe more
- Appealing Web 2.0 effects
- Production quality
Right now I have choosen jQuery (incl. jQuery UI) and see how far I get with it. It was to me the most appealing in terms of the above criterias. I am not sure if I need a sophisticated data table, if so I might have another look at YUI data table which seems to me one of the best widgets for this (compare to e.g. this jQuery plugin).
As a last hint: consider using Google Ajax Libs for speed up JS loading on your clients. However do not use it in local development. It just does not work reliable (loads too late etc.)