AJAX - The Complete Reference

(avery) #1

230 Part II: Applied Ajax


readers to look at Dojo for the simple reason that the Dojo team pushes the envelope and
many of the ideas other libraries use are rolled in here first, but if the past is any guide, be
prepared to dig into code or discover the newest advances in Ajax by pure trial and error.
Another library of note is MooTools (http://mootools.net), which is similar in philosophy
to Prototype in that it tries to “fix” some aspects of JavaScript. The Ajax support is certainly
not explorative like Dojo, but supports similar features to Prototype and YUI. It focuses more
on JSON conveniences. The library supports many effects, more so than widgets, and aims for
a very small download footprint.
Mochikit (www.mochikit.com) offers a somewhat Python-flavored approach to
JavaScript, and its Ajax approach takes a bit of inspiration from the Twisted event-driven
framework for Python. You’ll see the various drag-and-drop, effects, DOM manipulation
features, and so on in Mochikit. You will also see ideas like improved iterators to make
JavaScript act like another language—in this case Python. The author isn’t a large fan of
making JavaScript look like another language, and it is clear that Python, Ruby, and Java
camps are busy at work trying to co-opt JavaScript into something that doesn’t bother them
so much. Certainly influences from other languages are good, but creating all these various
JavaScript dialects seems a bit problematic.
We could go on for pages providing pointers to emerging or less popular JavaScript
libraries that have Ajax support, but things change so much we suggest users look to popular
sites like Ajaxian (ajaxian.com) to see what the hot JavaScript library is of the moment.

Summary


Developing an Ajax wrapper library is a great way to refine your skills as a JavaScript
programmer and abstract away lots of the details we have covered in the previous two
chapters. We hope the AjaxTCR library will be a useful learning tool to experiment with as
you explore Ajax further. We’ll continue to add to the library over the next few chapters and
move more and more from theory to practice. However, you eventually may want to move
on to a popular library such as YUI, Prototype, jQuery, or whatever is popular at the time
you make the leap. To assist you in making such a transition, we briefly surveyed some of
the most popular open Ajax libraries of late 2007 and discussed a variety of interesting
utilities and, in many ways, easier approaches to JavaScript. However, it was pretty clear
that on the communications level they really offered very little beyond what the educational
library did and, as you will see in the next chapters, they really could stand to address a
number of communications and security issues. Hopefully, this situation will change very
soon.
Free download pdf