BACKTRACE

(condense)

Back to Posts List

GET

Finally Decided: JQuery, not Prototype

JQuery (for those of you just landed from Mars) is an unobtrusive javascript framework. read more at the JQuery home page.
jQuery supports Behavior driven development and is based on traversing HTML documents by CSS Selectors.
vs.
Prototype,
Prototype is also JavaScript library for Class driven development which makes life easier working with JavaScript. Prototype library has a good support in Ruby on Rails via helper functions and is basically well embedded in.

i decided to try to match both of these libraries (and dojo for the matter of fact, but the project was halted), and here are my conclusions.


  • BDD


    JQuery is very similar to CSS by assigning the HTML element behaviour out-side the HTML, so it is generally more adequate for MVC.
    for ex:
    <br /> $(element).click(function() {<br /> alert("warning");<br /> });<br />
    simple.

  • Chaining
    Chining methods is as simple as ruby. period

  • CSS Selectors

    Since JQuery is based upon CSS, you can access any element by it’s CSS path, and avoid these annoying pesky ID’s you have to put using Prototype.


for some more comparisons, visit the Ajaxian article

Finally:
Jquery and prototype are both great. For me, i prefer JQuery since it’s approach appeals to me more than Prototype’s, Although prototype is kinda Rubish and has inbound support from Rails, JQuery is still cleaner to me.
Did someone said JQuery to Rails integration?

POST

blog comments powered by Disqus

I Don't have cookies.

ELAD ENV

Variable Value
LINKEDIN
TWITTER
FACEBOOK
GITHUB
WWR
IRC
{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#mootools' ]}
SKYPE
eladmeidar

You're seeing this error because I think it is funny.