Chapter 8. Savor the script.aculo.us JavaScript Library

Hacks 6367

Your web-application development efforts can substantially benefit from open source JavaScript libraries, if only because they save you time that would otherwise be spent reinventing the wheel. Chapter 6 used the Ajax tools of the powerful Prototype library. The hacks in this chapter use practical controls such as Mac OS X–style login boxes and auto-complete email fields deriving from script.aculo.us, an open source JavaScript library that Thomas Fuchs, a software architect in Vienna, Austria, has made available under an MIT-style license (see http://script.aculo.us). The library includes an impressive variety of special effects such as shakes, fades, and pulsations, as well as custom controls such as draggables, droppables, and auto-completing input fields.

script.aculo.us is built upon Prototype’s Ajax objects. Version 1.5 of script.aculo.us, for example, depends on Prototype v1.4. Thus, to use script.aculo.us’s collection of widget controls and special effects, you must import prototype.js along with scriptaculous.js. Simply use script tags in your web pages to include these two files; scriptaculous.js itself then loads its associated dependent code files, such as controls.js and effects.js.

script.aculo.us includes dozens of effects and tools. The following hacks will help you get started with this versatile library.

Integrate script.aculo.us Visual Effects with an Ajax Application

Include an impressive array ...

Get Ajax Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.