Prototype and script.aculo.us
You Never Knew JavaScript Could Do This!

Using the Prototype and script.aculo.us Javascript libraries to simply your life.

By: Staff


Partly due to their association with Ruby on Rails, Prototype and script.aculo.us have become two of the best known Javascript libraries in the last few years. While there are no shortage of articles and examples on the web on how to use them, I don't know of any other English-language books devoted solely to either at this time- though this is changing with at least one Prototype book coming out this spring, but "the bungee book" came first. What Christophe Porteneuve's book does offer you is a an insider's view (the author is part of the core team developing Prototype) of the library that will fill in a lot of the gaps in the online documentation, or at least brings together things that might take a lot of Googling to track down.

The first part of the book covers the Prototype library. Prototype basically adds a fair bit of functionality to the Javascript language and makes working with the DOM, forms, Ajax and the JavaScript language itself a fair bit easier - or at least less typing. Some commentators have suggested that Prototype tries to turn JavaScript into Ruby, I don't know enough about Ruby to comment on this, but there is a fair number of references to Ruby when discussing features, as well, the all the server-side code (used in the Ajax sections) is written in Ruby. If you need a primer on Rudy, the appendix explains how to install it as well as links to websites that will teach it- there is no tutorial in this book.

Coming from a PHP background, it took a bit of work to follow the server code, however I don't think re-implementing the code in another language would be difficult as the authors lay-out what the server code is meant to accomplish. On the other hand, the JavaScript in this book is not the simplest, readers should have a good grasp of the language, if not, I'd suggest picking up something like Pro JavaScript or similar if you want to get the most out of it.

While Prototype builds on JavaScript, the script.aculo.us library, builds on top of Prototype, adding many of the common "Web 2.0" elements: drag-and-drop, auto-completion and other animation effects. Readers looking to add these effects right away, might want to skim the first half of the book though before diving into the second half.

I'm not a big fan of books that devote pages to listings of code and this book fortunately doesn't do that a lot. They also print a URL to download the code, right above the listing which is a nice feature that I haven't seen in many books before. While on the layout itself, the book is about 400 pages, it's black and white, not the most inspired layout but still clear.

I learned a lot about Prototype from this book, beyond the $, $F and $$ bits that have since shown up in other libraries, most notably jQuery. In fact, there's a lot functionality that's probably overlooked by casual users. That's the greatest strength of this book - it shows you a lot of things you probably didn't know either library was capable of. Personally, I've been using Prototype and script.aculo.us for about 4 months now in a variety of small projects so there was a lot of material here that I probably would have discovered eventually, but this book covered a lot of material that I wasn't aware of.

Date published: 24-Jan-2008





Eloquent JavaScript

By treating JavaScript as a language in its own right, the author has produced a solid guide to learning a language you might think you already knew.

Learning jQuery 1.3

Learning to use jQuery to build better websites, though examples and popular plug-ins.

Algorithms in a Nutshell

Before picking an algorithm know what problem you're trying to solve.

Coders at Work

Talking to programmers.

CakePHP Applications Development

Learning the CakePHP 1.2 framework though examples.


2019 YYZTech

For American computers stores, visit: AmericanComputerDealer.com