For years I avoided Javascript as much as possible. It was a pain to try and support all of the versions of Internet Explorer (IE) and Netscape Navigator. It just was not worth it. As time went on my aversion to Javascript lessened, but I never made the effort to really learn it as a language. I would learn just enough to accomplish a small specific task.
Fast forward to 2005/2006. AJAX has become the buzzword of choice. Some smart folks have learned to deal with most/many of the issues that are still there between IE and (now) Firefox. This has given rise to Javascript libraries, with Prototype being one of the more popular.
After a few brief attempts trying to figure out how to do something useful in Javascript with Prototype I figured my lack of real Javascript skills were just not up to the job. Then Yahoo came out with their Yahoo! User Interface Library (YUI), which got me thinking about Prototype again. After reading through more examples and documentation I was finally able to accomplish exactly what I wanted.
I’m now sold on using Prototype. Sam Stephenson deserves heaps of praise. To help out others who are looking for documentation and examples, here is a list of resources for Prototype.
- Prototype: The official website for Prototype.
- Prototype Subversion repository: Sometimes looking at the source (and its history) is the only way to answer a question.
- Developer Notes for prototype.js: This site provides great examples on using Prototype and an amazing reference section. If you use Prototype at all this is a site you’ll want to bookmarked for easy access.
- Easily upgrade your forms to AJAX: A lot of AJAX activity focuses around HTML forms, this page provides a basic example on how Prototype makes that possible.
- script.aculo.us prototype wiki: Another good reference site with some examples.
- Overview of the Prototype Javascript Library: Provides a good, quick over view of what is possible.
While trying to debug AJAX I recommend using the Firefox plugin called FireBug. Turn on the “XMLHttpRequest Spy” feature and you’ll be able to monitor all of the AJAX transactions that are going on.
Of course Prototype isn’t perfect, there are still important limitations and issues to keep in mind. For instance, the target platforms for Prototype are (from the README):
Microsoft Internet Explorer for Windows, version 6.0 and higher
Mozilla Firefox 1.0/Mozilla 1.7 and higher
Apple Safari 1.2 and higher
I’m also curious to see how it stacks up against the new Yahoo User Interface Library. Either way this is an exciting time in the land of Javascript.