Comparing Popular JavaScript/Ajax Frameworks

After four days of ASP.NET AJAX training with Stephen Walther I set out to learn more about my options in choosing a solution for a JavaScript/Ajax framework.  If I realized days later I would be writing this comprehensive post on 7 of the most popular frameworks, I may have just went with the "Inny-Minny-Miney-Moe" method!   I decided to share my research, analysis, links, resources, and personal grade for each of the frameworks compared - jQuery, YUI, Prototype, Dojo, MooTools, Ext JS, and Script.aculo.us.  I put together a comparison matrix to illustrate where many of the frameworks differ.  I did not spend a great deal of time comparing features side-by-side simply because most complete frameworks offer very similar functionality (perhaps another post? :P).

JavaScript Framework Comparison Chart

>> jQuery

jquery
http://jquery.com
Current Version: 1.2.3
Download Size: 94.5 KB
Grade: 9/10

"jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript."

jQuery's framework is based on the jQuery object that extends the DOM, as opposed to taking a class-oriented approach (provided using the  $ operator).  The "Magic of jQuery" stems for the chainability of method calls, much like C#.  Each method in this framework returns the base jQuery object, allowing you to access functionality in a chained fashion.  One particularly nice feature of jQuery is the ease by which Ajax calls can be made.  Examples of simple callbacks can be found at http://docs.jquery.com/How_jQuery_Works#Callbacks_and_Functions.

You will notice in the comparison chart provided in this post that jQuery is one of the only JavaScript frameworks built using an Official Plug-In Architecture that allows easy extension.  One reason I believe this is a strong framework choice is the myriad of extensions (framework, widgets, and UI controls) that are available through the jQuery community.  Their well-designed API/documentation and live examples reflect the maturity of this framework.  A variety of google groups are also in place of standard forums.

Highlighted Extensions/Controls/Widgets


>> Yahoo! UI Library

yui
http://developer.yahoo.com/yui/
Current Version: 2.5.1
Download Size: 49.7 - ? KB
Grade: 8.5/10

"The Yahoo! User Interface (YUI) Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX."

The Yahoo! UI Library is a very complete collection of controls, animations, and utilities, though it tends to be a little "heavier" than most of the frameworks.  All the controls are based on a few core scripts - Yahoo Global Object, DOM Collection, and Event Utility.  While the learning curve for the YUI Library is a little steeper than most frameworks, you only need to include the features you are utilizing.  This library is a stable, mature option with many advanced tools not commonly found in many lightweight frameworks such as a logging control, testing utilities, and browser profiling.

The extensive documentation and live examples (complete with full code) depict the strength of the framework.  Yahoo groups are also available for troubleshooting and discussion topics.  Handy cheat sheets are also available for download to get you rolling with YUI.

Highlighted Extensions/Controls/Widgets


>> Dojo Toolkit

dojo
http://dojotoolkit.org 
Current Version: 1.1
Download Size: 75 - ? KB
Grade: 7.5/10

"Dojo is an Open Source DHTML toolkit written in JavaScript. It builds on several contributed code bases (nWidgets, Burstlib, f(m)), which is why we refer to it sometimes as a "unified" toolkit. Dojo aims to solve some long-standing historical problems with DHTML which prevented mass adoption of dynamic web application development."

The Dojo Toolkit is a stand-alone solution that offers the comparable Ajax (including JSON support), Event, CSS, and animation features in the core implementation.  The flexibility of this framework allows the addition of several optional modules like support for unit testing, debugging, and much more.  It may not be as mature as jQuery or Prototype, but the Dojo toolkit is a powerful library.  Provided extension libraries Digit and DojoX offer many advanced controls and features for creating widgets, data display and manipulation, theming, and more.

The demos on the official Dojo Toolkit site are disappointing.  Most useful demos exist on external sites provided by project contributors, which is a bit of a deterrent.  The API could also use a little work to make it more complete.  It is good to note that this is one of the only solutions that offers professional training besides Ext JS.

Highlighted Extensions/Controls/Widgets


>> Prototype

prototype
http://prototypejs.org/
Current Version: 1.6.0.2
Download Size: 124 KB
Grade: 7/10

"Prototype is a JavaScript Framework that aims to ease development of dynamic web applications. Featuring a unique, easy-to-use toolkit for class-driven development and the nicest Ajax library around, Prototype is quickly becoming the codebase of choice for web application developers everywhere."

Prototype takes a class-oriented approach to extending the DOM and makes those extensions available in a variety of ways ($ and $$ operators being the most common).  The library is very simple to use since it is conveniently modularized into separate class entities.  Ajax implementations are very straightforward and can support JSON formats.  A strong focus on extensibility via subclassing and inheritance is the backbone of this framework's flexibility.

My biggest gripes around this framework are the lack live examples and discussion avenues, as well as the lack of UI features without the inclusion of Script.aculo.us.  I could see handing out a grade of 7.5/8 had those aspects of the framework been stronger.

Highlighted Extensions/Controls/Widgets


>> Ext JS

extjs
http://extjs.com 
Current Version: 2.1
Download Size: 510 KB
Grade: 8.5/10

"Ext JS is a cross-browser JavaScript library for building rich internet applications that includes high performance and customizable UI widgets, a well designed and extensible Component model, and an intuitive, easy to use API."

Those familiar with the Yahoo! UI Library will recognize Ext JS as it was previously an extension framework solely for YUI, however it now support jQuery, Prototype, and it's own library as the base component.  Ext JS is a relatively new, and impressive, option in the JavaScript framework realm.  Their website recently underwent a dramatic renovation and offers a really well-designed set of samples, but falls short with it's web-based code samples.  All sample code will need to be downloaded - a minor inconvenience.

Coolite Studio recently announced a collection of ASP.NET controls based on Ext JS that are definitely worth a few minutes of your time.  I also really like that their online API is built using their framework - neat!


>> MooTools

mootools
http://mootools.net   
Current Version: 1.1
Download Size: 9 - ? KB
Grade: 6.5/10

"MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API."

MooTools is another recent addition to this rapidly growing space.  The framework takes a class-oriented approach that is similar to Prototype's structure.  It is one of the more lightweight options out there.  In fact, the most basic implementation boasts a measly 9KB script.  However, you will be sacrificing certain features that most (if not all) libraries offer out-of-the-box (e.g. form validation).  Like the other libaries discussed in the post, Ajax is a supported feature.  The implementation is a bit different than other frameworks, but it still seems easy enough to use (especially for the ASP.NET developers out there).  There are active forums available on MooTools' website.  I like what I see with this framework, but I think it will really benefit from a little more time to mature into a more powerful library.


>> Script.aculo.us

scriptaculous
http://script.aculo.us
Current Version: 1.8.1
Download Size: 262 KB
Grade: 7.5/10

"Script.aculo.us provides you with easy-to-use, cross-browser user interface JavaScript libraries to make your web sites and web applications fly."

This library is an extension to the Prototype framework aimed at offering the UI elements Prototype ignores.  Script.aculo.us focuses on offering six core UI effects - highlight, morph, move, opacity, parallel, and scale.  More advanced UI effects can be accomplished, however they require the use of combination effects.  There are a set of 15 controls available out of the box with Script.aculo.us (e.g. Ajax AutoComplete and Drag & Drop). 

If you are strictly focused on UI effects this is a great solution.  It offers a powerful set of UI tools, but I am a little weary that the project is run by one developer.  It is hard to argue against this solution when you look at the real world usage though.


Conclusion

There are a several great options when choosing a JavaScript framework for your company/project.  My personal choice would be jQuery as my base library, and the optional use of Ext JS as an extension.  Prototype + Script.aculo.us is another very popular solution, but as I mentioned I like the stability offered by jQuery and Ext JS.  Your choice will really depend on the features and functionality you require.  Hopefully this comparison helps in making the decision easier by promoting the strengths and weaknesses of the different libraries. 

What do you use in your applications, and, more importantly, would you recommend it?

(For anyone that wants to use the analysis for corporate justification, I will be providing a word document in the next day or so that wraps up this post in a nicely formatted fashion)

Kick It!

  • Permanent link to this post Permalink 
  • Share this post! Share It! 
  • View this post's comments Comments (24) 
  • RSS Feed for this post's comments Comment RSS
  •    


Comments

Posted on 04.22.2008 08:05 AM #

Andrew

Andrew
YUI uses BSD License

Posted on 04.22.2008 08:19 AM #

Danny

Danny us
Thanks for catching that typo Andrew - I've updated the comparison matrix.

Posted on 04.22.2008 08:20 AM #

superjason

superjason us
I've been using jQuery for quite a while now, and I simply love it.

Posted on 04.22.2008 11:06 AM #

Danny

Danny us
There is an interesting "Selectors Speed Test" provided by MooTools at http://mootools.net/slickspeed/. Pretty neat, and seems unbiased - worth your time to check it out. Compares Dojo, MooTools, jQuery, and Prototype.

Posted on 04.22.2008 19:03 PM #

tracker1

tracker1 us
I think that there are a couple issues with Prototype & Scriptaculous in the chart..

Modular Design (scriptaculous is a yes here) Though prototype isn't so much a modular design, the inheritance model it allows does make a base for other more modular libraries, as scriptaculous comes closer to, you don't need to use the entire scriptaculous library for only certain points of functionality.

As to Funded Development, this is kind of a misnomer since the prototype and scriptaculous libraries are branched out of the RoR project which does have a bit of commercial backing... I also don't feel it isn't really a limitation in either case, just stating that not being directly funded doesn't mean it doesn't have the support of paid developers working on the library.

Also, it's really unfair to compare prototype with a lack of UI support without considering scriptaculous... early on, they were both part of one framework, but the UI layers were split off (and rightly so, imho)... they really should have been compared as a cohesive unit imho...

Also, the prototype/scriptaculous book is imho probably the best book regarding advanced javascript techniques available. The pro js techniques book from Apress is also a decent book, written by one of the jQuery developers.

I'm not looking down on the comparison as it's an interesting perspective, I just don't think it really considers how the frameworks are used... Dojo and Ext being full web-app JS orienty UI frameworks, YUI and some of the stuff with mootools and jquery being just short of that, with scriptaculous being a base for advanced ui, and prototype being a JS enhancement library...

They serve different needs, yes there is overlap but that is a different point.

Posted on 04.23.2008 04:32 AM #

kris

kris pl
ExtJS is GPL! Since 2.1. More, they claimed that it wasn't LGPL before, only some kind of mutation. Funny guys.

Posted on 04.23.2008 11:38 AM #

Danny

Danny us
@tracker1 - Thanks for the response. I do agree that Prototype + Script.aculo.us provide a much better solution as a package, as I believe jQuery + Ext JS are a stronger solution together than apart. A functional comparison would analyze some of these individual options in a joint fashion, but that was not my intention here. Each framework exhibits different strengths for various scenarios as you mentioned.

I can respect your point as it offers valid, constructive criticism. Thanks for the feedback!

Posted on 04.23.2008 11:39 AM #

Danny

Danny us
@kris - 12 hours after I posted this comparison Ext JS made a release and updated their license. I'll be updating this post as soon as I get the opportunity to reflect those changes.

Thanks for the heads-up!

Posted on 04.23.2008 12:04 PM #

alejjak

alejjak us
Nice article! thanks for taking the time to do this. however i'd like to comment on Ext JS is NOT free for commercial and should be noted not with footed note, this is a main restriction . Their libraries are nice but very expensive.
I use prototype, and its sad they dont have a namespace which could potentially create problems when developing with other libs.

Posted on 04.23.2008 13:17 PM #

Danny

Danny us
@alejjak - It was my understanding that Ext JS was free for any use, however you were still under the restraints of the open source GPL license, and the paid commercial licenses freed you from those limits.

Posted on 05.2.2008 05:11 AM #

Shane O'Sullivan

Shane O'Sullivan ie
Regarding the Dojo demos, the situation is better than you make out. The Dojo Feature Explorer is available at http://www.dojocampus.org/explorer , and is linked to from the Dojo Demos page, http://www.dojotoolkit.org/demos

Posted on 05.9.2008 07:39 AM #

Andre

Andre de
Nice article, thanks for that. I like jQuery, too

Posted on 05.27.2008 13:40 PM #

Jamie Rytlewski

Jamie Rytlewski us
By the way, YUI supports Safari 3.x on Mac OS 10.4 and 10.5 and does not evaluate Safari 2.x.

http://developer.yahoo.com/yui/articles/gbs/

Great Article, but one question I had was about "I could see handing out a grade of 7.5/8" under prototype. Was that supposed to be an 8? As the rest were out of 10.

Posted on 05.27.2008 15:23 PM #

Danny

Danny us
@Jamie - the rating was out of 10 (7/10), but I was clarifying that I could have been convinced to raise that rating to a 7.5 OR 8 given the points listed above. Hope that helps clarify. =]

Posted on 09.4.2008 01:51 AM #

mac flv converter

mac flv converter nl
hi.hohayou!!Nice article, thanks for that. I like jQuery, too

Posted on 09.17.2008 11:00 AM #

Tercüme

Tercüme bg
I've been using jQuery for quite a while now, and I simply love it...
http://www.tercumehizmeti.com tercüme bürosu

Posted on 09.30.2008 15:27 PM #

Daniele Simonin

Daniele Simonin it
Very useful post, thx.
I have used Prototype+Scriptaculous but i prefer jQuery, i love it!

Posted on 09.30.2008 19:57 PM #

Thomas Hansen

Thomas Hansen no
Dojo is the by far most mature library commonly used these days, jQuery was started in late 2005, that time Dojo was like 5 years old already or something...
ExtJS is a commercial alternative, not that it matters that much, but the *only* commercial alternative in your list. And this might matter to some people (you cannot build proprietary apps without purchasing a "commercial license" ("proprietary" is more semantically correct word though))

Also you have a whole range of other Ajax libraries which have a far easier learning curve for existing application developers who just want to ASAP do "the leap" which includes GWT, ExtGWT, Anthem.NET, and the one in my signature...
I won't mention their advantages since that would be a shameless plug, and also eat your database capacity ;) but there are MANY advantages for using a "no-JavaScript Ajax library"...

Posted on 10.1.2008 02:27 AM #

Vipul Limbachiya

Vipul Limbachiya in
I've been using prototype/scriptaculous few months ago.

Now shifted to jQuery. I must say jQuery rocks.. It's been too easy and flexible.

Love jQuery.

Thanks for the post!

Posted on 11.20.2008 05:24 AM #

mobile phones deals

mobile phones deals us
We all know that Ajax came after Java.. But Ajax occupied a good position than Java only because its an friendly language..
Even that Letter J in Ajax stands for Java...

Posted on 11.20.2008 05:42 AM #

water damage

water damage us
Hey mobile phones you are exactly right..
.Net is user friendly open source language..Java scripting is very very tough.

Posted on 11.20.2008 08:47 AM #

Site ekle

Site ekle uy
Their libraries are nice but very expensive.

Posted on 11.20.2008 08:51 AM #

Program download forum

Program download forum ca
The extensive documentation and live examples (complete with full code) depict the strength of the framework. Yahoo groups are also available for troubleshooting and discussion topics. Handy cheat sheets are also available for download to get you rolling with YUI.

Posted on 11.20.2008 16:31 PM #

short term health insurance

short term health insurance us
i prefer jquery rather than using ajax,in my view jquery is more flexible for jprogrammers rather than ajax

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading

search


AddThis Feed Button

blog categories

blog tags

my pictures

Flickr Gallery Coming Soon!

recent comments   RSS Feed for this post's comments