Wednesday, February 22nd, 2006

Painless JavaScript Using Prototype

Category: Programming, Prototype

In this new post on the “Javascript & DHTML Tutorials” blog from SitePoint, Dan Webb demonstrated how to use the Prototype library to make “painless Javascript” for your site.

Personally, I think the jury’s out on the whole ‘fun’ JavaScript thing, but nevertheless Prototype is a really well executed JavaScript library which, although the situation has been improving of late, has had notoriously sparse documentation. This article provides a whirlwind tour of the whole library. It aims to give you enough examples and resources to get started using Prototype in your DOM scripting projects.

The article reads like an introduction to Prototype, starting with the basics of installation and mentions of the helper functions. Following that, they move into more complicated things – extending the class, binding functions, and handling iterations “the Ruby way” (enumerable and hash).

They finish off things with a look at three more developed topics – how to use the library to help manage HTML forms, simple examples of how to alter the DOM of a page, and, of course, using Prototype for Ajax. The form functions allow you to work quickly and easly with HTML forms. This includes things like putting the focus on a field, serializing the results of the form. They show how the DOM functionality can insert/remove content on the page, and provide a simple example of the Ajax methods to connect to a remote PHP script.

Posted by Chris Cornutt at 8:05 am

4 rating from 35 votes


Comments feed TrackBack URI

[…] Painless JavaScript Using Prototype: […]

Pingback by Sam’s random musings » Painless JavaScript Using Prototype — February 22, 2006

[…] Blogged on Painless JavaScript Using Prototype [JavaScript & DHTML Tutorials] […]

Pingback by abhin4v’s blog » Blog Archive » Painless JavaScript Using Prototype [JavaScript & DHTML Tutorials] — February 24, 2006

Leave a comment

You must be logged in to post a comment.