Prototype Tutorial with examples



In Javascript you often need to use a set of tasks used again and again. To prevent you from reinventing the wheel, Sam Stephenson developed Javascript prototype aimed ar easing the development of web applications. With prototype, you can manipulate the elements of your web page easily.

This prototype tutorial is intended for beginners who wish to extend their knowledge of javascript to make them more efficient.

Pre requisite


We expect that you have a working knowledge of javascript. If not, you may like to learn javascript with our popular javascript tutorial . It will create a basic understanding of the javascript and you can then learn Prototype.

jQuery - the prototype alternative


jQuery is anothe parallel and equivalent of the Prototype. If you have not started any javascript library we suggest that you take a close look at jQuery which is evolving faster the prototype. If you still need to work on an existing code that uses prototype, you have no alternative but to learn prototype. The jQuery tutorial can be found here .

Installing Prototype?



Prototype is a set of javascript functions grouped together. All you need to do is include a file called prototype.js in your script. The file itself can stay in the current directory or, preferably in a subdirectory. In the next page we will show you how to do it exactly and will develop our first prototype program.

Throughout this tutorial we will develop numerous examples that you can try and practice. The best way to learn is to make changes in the source code and see its effects. Fortunately we have tools to make changes in the source code online and see its effects.

Let us now move quickly to our first prototype code - in the next page