Web20 are the cornerstone of AJAX, and now several online popular open source AJAX frameworks, such as: jQuery, Mootools, Dojo, Ext JS and so on, then we in the end of the circumstances under which the use of that framework? Following excerpt is a set of data :

Ajaxian of Ajax at the end of 2007 conducted a survey tool, some of the findings is shown below (figure for one of those who use the tool to investigate the percentage of detail please see the website): http://ajaxian.com/archives/2007-ajax- tools-usage-survey-results

Prototype jQuery Ext Script.aculo.us Mootools YUI JSON Dojo Backbase

34.1% 29.3% 22.5% 22.3% 14.3% 13% 12.9% 11.8% 8.3%

Prototype one of the highest utilization rate, largely because it was one of the earliest sophisticated framework, a lot of previously adopted in the project, so now has been used

Let us take a look at the selection of the basic AJAX framework:

Needs of your project (that is, what features you need, such as whether the request beautiful interface, special effects or other features)

Whether to support the A-level browser (IE, Firefox, etc.)?

The quality of the document: Is it perfect (including tutorials, API, sample code, etc.)

Framework scalability how? Writing plug-ins for the framework easy to do?

Do you enjoy its style API?

Most of the extent to unify your JavaScript code style?

The framework of the size (too much users download the framework of lead time)

The framework of forcing you to change the way HTML Writing (Dojo is one such)?

Code execution speed: how to performance?

Code for modular (Mootools for the highly modular)? Code reusability how?

First, jQuery

Home: http://jquery.com/

http://code.google.com/p/jqueryjs/downloads/list

Design idea

Simple idea: almost all operations are to select DOM elements (have powerful Selector) started its operation are then (Chaining and other characteristics).

Advantages

Small, compressed code only after more than 20 k (no compression code 94k).



Chaining: always return a jQuery object, can be continuous operation.

Document integrity, ease of use (one for each API has a complete example, which are other than the framework should not now), but online there are a lot of other documents, books.

A wide range of applications, including the google code is also used jQuery.

The use of jQuery site: http://docs.jquery.com/Sites_Using_jQuery

The core development team and core staff members: John Resig and so on.

Concise and brief grammar, easy to remember.

Scalability: a large number of users have developed plug-ins available (http://jquery.com/plugins/)

jQuery UI (http://jquery.com/plugins/, based on jQuery, but the core of jQuery are independent), and constantly developing.

Friendly and active community: google groups: http://docs.jquery.com/Discussion

Deal with case has a lot of convenience methods, such as click, rather than a single type addEvent.

Disadvantage

Because of the design idea is to seek efficient and simple, there is no object-oriented expansion. Design ideas and Mootools not the same.

CSS Selector speed slightly slower (but now has been a substantial increase in speed)

Second, Mootools

Home: http://mootools.net/

Design idea

Object-oriented design idea.

Advantages

Modular, each module is an independent code, the smallest core only 8k, The biggest advantage is to choose which modules, when used only to import the module can be used, not to complete 180k (no compression), compression less than 70k.

The grammar is simple and intuitive.

Effects (Effects): This is slightly stronger than jQuery, but now they are being developed Mootools UI (this should be the Ajax framework to develop a trend).

Code written in a beautiful, easy to read and modify.

Integrity of the document (the latest 1.2beta document in greater detail than before).

Active in the community: official website (http://forum.mootools.net/), there is a IRC.

Performance: See: http://mootools.net/slickspeed/

Disadvantage

Amended a number of low-level categories: such as Array, String, etc. This is also a different design idea.

In DOM and CSS Selector is inferior to the powerful jQuery.

Three, Dojo

Home: http://dojotoolkit.org/

Advantages

Behind the strong support: IBM, Sun, BEA, etc. This is a very important advantage.

Features a powerful, Full Stack framework extends the capacity of DHTML, such as:

Support and browser Back / Forward button integrated.

Dojo Offline, a cross-platform offline storage API.

Chart components, can be easily generated in the browser client charts.

Based on the SVG / VML vector graphics library.

Google Maps, Yahoo! Maps components, facilitate the development of Mashup applications.

Comet support, through a common protocol Buyeux.

Powerful UI (Dijit).

Object-oriented design, unified namespace, package management mechanism (The Package System and Custom Builds)

Scalability.

Disadvantage

Complex, steep learning curve.

Extreme incomplete documentation, this is a big problem.

API a lot of instability, the larger the changes between versions, it is not is a sophisticated framework.

Too invasive, large-scale use of dojo page of the property, for example, if in future upgrades or dojo for a framework, the burden would be significant.

Performance problems, because of the use of dojo to load the synchronization mechanism will temporarily lock the browser, causing CPU utilization to reach 100%. In addition, a lot of very slow Widget.

Four, Ext JS

Home: http://extjs.com/

Design idea

Components, and promote the RIA (Rich Internet Application) applications.

Advantages

Powerful UI, and good performance, which is its greatest strengths.

Speed control is the UI or other modules.

100% object-oriented and component-based idea, the same grammar, global namespace.

Document integrity, standardization, and convenience.

The core development team, Jack Slocum, etc..

Active communities, the rapid increase in user traffic.

Modular implementation, scalability and strong.

All of the components (widgets) can be used directly without the need to set (of course, the user can choose to re-configuration).

Disadvantage

Slightly complex.

Framework for the heavyweight (including a large number of UI), and bulky. If the import ext-all.js, compression also has near 500k.

Note: EXT commercial use: If you just put extjs included in their own projects, but this item is not sold to users to do the secondary development of the toolbox, or component library, we can comply with the free use LGPL protocol; otherwise have to pay .

Aggregate

Choose lightweight

Choose lightweight: mainly mootools and jquery, because of their different design idea, jQuery is a concise and efficient pursuit, Mootools outside apart from the pursuit of these goals, the core is object-oriented, so jQuery fit in the rapid development, Mootools fit in the slightly large and complex projects, which required the support of object-oriented; In addition, at the Ajax support, jQuery some slightly; at Comet's support, jQuery plug-ins have related, Mootools is currently no, but the core of Comet is supported by the server, browser client interface is very simple, the development of plug-ins is very simple.

In Object-Oriented Javascript Library Medium, mootools gradually defeated the prototype (the size of large object-oriented design unreasonable, etc.), but also script.acul.ous (based on the prototype, in fact is the prototype of the UI library).

RIA-oriented framework

Consider pure JavaScripty library, are currently the main Dojo and ExtJS (still YUI). Dojo is more suitable enterprise applications and product development needs, because off-line storage, DataGrid, 2D, 3D graphics, Chart, Comet and other components for enterprise applications are very important (of course these components have to wait some time before stabilized). For example, BEA technology development Mashup-based products have been used Dojo.

ExtJS: the appearance and "easy-to-use" and powerful enough. In the UI have relatively large demand, the first choice.