Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Chapter 23: Enhancing Development with Dojo Core
Chapter 24: Manipulating the DOM
Chapter 25: Handling Events
Chapter 26: Composing Animations
Chapter 27: Working with AJAX and Dynamic Data
Chapter 28: Building User Interfaces with Widgets
Chapter 29: Building and Deploying Dojo
Chapter 30: Expanding Dojo
Dojo is an open-source framework that began life as an effort to unify a handful of separate DHTML toolkits and JavaScript utility libraries. As such, the Dojo toolkit offers all the amenities expected from modern JavaScript frameworks. You'll find basic language enhancements, as well as the usual tools for dealing with DOM manipulation and AJAX requests.
Where Dojo really shines, though, is with its facilities for building user interfaces and whole applications using declarative HTML markup. Rather than piecing together applications with long stretches of object initialization code and wiring up DOM elements, Dojo offers the ability to scan the page itself for setup cues in Dojo-specific attributes and conventions. Though you still can choose to build things without this declarative style, it can help speed development.
Another major pillar of the toolkit is its packaging system, organizing a rich set of libraries, components, widgets, and extensions. All modules are laid out in a clear namespaces not unlike the standard library you'd find in languages like Java or Python.
And having a clear structure is good, because Dojo offers a lot. Fortunately, you don't have to use it all at once: In conjunction with the organizational facets of the packaging system, Dojo offers facilities for dynamically loading modules and any declared dependencies — all of which can be later optimized away through custom builds that bundle required code together into a single compact JS include. Additionally, Dojo's packaging system can be used to organize and locate CSS, images, and other assets associated with widgets and code in your projects.
And finally, no introduction to Dojo would be complete without mentioning the nonprofit Dojo Foundation, which was established to sponsor the project as well as to bring clarity and consistency to the licensing under which each contribution is covered. Each contributor to the project is required to sign what's called, appropriately enough, a Contributor License Agreement. This agreement makes explicit the desire to allow work to be offered as part of the Dojo framework.
Subsequently, the Dojo framework can be licensed under either the terms of the BSD license or the Academic Free License — both of which, among other things, allow the clear use of Dojo in commercial projects without separate licensing or fees and helps promote liability-free contributions from the community.