Anyone who has spent more than five minutes writing JavaScript knows that dealing with cross-browser issues is far more trouble than it’s worth.
It’s also really not a good idea to roll your own widgets for common things such as date pickers, tabs, and other UI elements.
That’s why JavaScript frameworks exist — they exist to solve the same problems every web developer must face. If there wasn’t a need for them there wouldn’t be more than a dozen: Dojo, Echo3, ExtJS, Google Web Toolkit, jQuery, Midori, MochiKit, MooTools, Prototype, Pyjamas, Qooxdoo, Rialto, Rico, script.aculo.us, SweetDEV, YUI, and ZK.
These frameworks have varying levels of maturity and popularity. I like to judge them by the number of books have been written. A good rule of thumb is that a technology is mature if it’s been around long enough to have a how-to book published. For the other thumb, you can judge a technology’s popularity by the quantity of books that have been published.
By this standard, it looks like Dojo (7 books), ExtJS (3 books), Google Web Toolkit (10 books), jQuery (9 books), MooTools (2 books), Prototype + script.aculo.us (4 books), YUI (1 book), and ZK (2 books) are all mature. Since Dojo and jQuery are among the most popular, I decided to try using both and sticking with whichever works better.
It turns out that Dojo and jQuery have a very similar set of capabilities. The ones I were most interested in were tabs, streamlining of AJAX calls, a slider, and a date picker.
After spending a bit with the docs, all of those tools were easy to implement in both frameworks. I liked the way Dojo used attributes on page elements (dojoType=”dijit.form.HorizontalSlider”) more than the way jQuery creates elements (in the document.Ready() function). It turns out that jQuery’s method results in smoother page rendering.
After I finished figuring out how to use each of them, I compared the rendered pages in a few browsers. Dojo’s tab control doesn’t quite work right with IE, which makes it a deal-breaker. jQuery’s the winner, at least for my future projects.