Prototype Tutorial

Wednesday, February 22nd, 2006 @ 2:07 pm | filed under: Best Practices, Examples, Manipulating the Dom, Prototype, Reference

I read through about half of this so far and it’s great. Lots of info on how to make use of prototype’s powerful scripting shortcuts and plenty of best-practices examples. via Ajaxian:

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.

No TweetBacks yet. (Be the first to Tweet this post)

One Response to “Prototype Tutorial”

  1. coderbari Says:

    Great article man.You gathered nice information.