JQuery vs Prototype

From WikiVS, the open comparison website

Jump to: navigation, search
jQuery Prototype
jQuery
VS
Prototype
http://jquery.com http://www.prototypejs.org

jQuery and Prototype are cross-browser Javascript frameworks that allows Javascript programmers to program with ease and portability. Prototype features a standard Object-Oriented programming layout, whereas jQuery attempts to provide a more declarative API. jQuery is current at version 1.4.2 and Prototype is at 1.6.1.

Contents

[edit] Feel

Prototype feels like an extension to the Javascript language, providing elegant methods to classes. The extra methods are similarly named to Ruby equivalents, and so Ruby programmers will feel more comfortable using it. In fact, Ruby on Rails, a popular web development framework built on Ruby ships with Prototype by default.

jQuery has a completely different feel from Prototype and the Javascript language in that it tries to be declarative and functional. jQuery is strongly associated with unobtrusive programming techniques because of its design: programming in jQuery feels like you're attaching javascript behavior to CSS selectors. In fact, many jQuery plugins are actually created to overcome browser-incompatibilities with CSS and shortcomings in CSS in general.

[edit] Modularity

jQuery has a small core library that is roughly 155KB unminified. There are hundreds of jQuery plugins available, outside of the standard plugins.

Prototype also has a small core library that is roughly 140KB unminified. Prototype also has hundreds of plugins available.

[edit] Standard plugins

jQuery has a UI plugin extension called jQuery-UI that provides widgets and animations. Prototype has an animation library called Scriptaculous. jQuery-UI focuses more on widgets and element "behaviors" whereas Scriptaculous focuses more on animations.

[edit] Speed

Browsers process jQuery faster than Prototype.

[edit] Bulk

Both jQuery and Prototype are very light frameworks that have small core libraries.

[edit] Features

[edit] Selectors

Both jQuery and Prototype support advanced CSS and XPath selectors. This was probably the greatest revolution in Javascript programming, and has prompted CSS selectors to be implemented in the core Javascript language.

[edit] Live

Extending the concept of "behaviors" on elements, jQuery 1.4 comes with a live() method that allows users to apply behaviors to CSS selectors that will be applied to elements even when they created after the fact.

[edit] DOM

Both jQuery and Prototype allows access to DOM elements through the $() method. The DOM elements are wrapped in both cases. Prototype DOM wrappers act like DOM node objects themselves, whereas jQuery DOM wrappers act like accessors that manage the DOM nodes.

[edit] Animations

jQuery's core library does not come with animations, but jQuery-UI provides some animations.

Prototype itself does not come with animations, but Script.aculo.us, an animation library based on Prototype, provides a greater set of animations than jQuery-UI does.

[edit] Method Chains

jQuery allows rapid programming through method chains. Prototype provides similar functionality through bind().

See Also the Following Articles

Personal tools
Related Ads