Featuring a unique, easy-to-use toolkit for class-driven development and the nicest Ajax library around, Prototype is quickly becoming the codebase of choice for web application developers everywhere.
It allows writing code in a familiar class-style OO framework, with extensive Ajax support, higher-order programming constructs, and easy DOM manipulation.
Prototype framework enables you to deal with Ajax calls in a very easy and fun way that is also safe (cross-browser). Besides simple requests, this module also deals in a smart way with JavaScript code returned from a server and provides helper classes for polling.
The biggest part of the Prototype framework are its DOM extensions. Prototype adds many convenience methods to elements returned by the $() function: for instance, you can write $('comments').addClassName('active').show() to get the element with the ID 'comments', add a class name to it and show it (if it was previously hidden).
The 'comments' element didn't have those methods in native JavaScript; how is this possible? This document reveals some clever hacks found in Prototype.
JSON (JavaScript Object Notation) is a lightweight data-interchange format (if you are new to JSON, you can read more about it on the JSON website). It is notably used by APIs all over the web and is a fast alternative to XML in Ajax requests. Prototype 1.5.1 finally features JSON encoding and parsing support.
Here are some key features of "Prototype":
Prototype currently targets the following platforms:
· Microsoft Internet Explorer for Windows, version 6.0 and higher
· Mozilla Firefox 1.5 and higher
· Apple Safari 2.0.4 and higher
· Opera 9.25 and higher
· Chrome 1.0 and higher
Requirements:
· JavaScript enabled on client side
What's New in This Release: [ read full changelog ]
· Ensure `Element#update` works with string content that includes a LINK tag in Internet Explorer.
· Treat a 304 HTTP status as a successful response.
· Handle sparse arrays properly in `Array#_each` to match behavior with browsers' built-in `Array#forEach` (and ES5).
· Make `Event.extend` work with legacy IE events in IE 9.
· Stop appending `&_=` to the parameters for non-GET Ajax requests in Safari. We no longer support any version of Safari for which this is necessary.
· Ensure `Form.focusFirstElement` doesn't raise an exception on forms with no fields.
· Define a `relatedTarget` property on extended mouseenter/mouseleave events in IE's legacy event system.
· Fix odd behavior with `new Element('select')` in IE6-7.
· Extend BUTTON elements with everything defined in Form.Element.Methods. Ensure BUTTON elements are traversed in Form.getElements and serialized in Form.serialize.
· Ensure Object.isFunction returns `false` for RegExp objects.
· Revert Opera-specific behavior for calling Element#getStyle with (left|right|top|bottom).
· Fix issue with Event#isMiddleClick and #isRightClick on Safari and Chrome.
· Fix issue where an Ajax request in IE sometimes returns 1223 instead of 204 as the status code.
· Add Object.isDate.
· Handle cases where `document` or `document.documentElement` is passed into Element#getOffsetParent. Fixes IE errors with many layout/positioning methods.
· Wrap `element` in `$` for Element#cumulativeOffset, #viewportOffset, #positionedOffset, and #getOffsetParent.