I have never used Prototype before.
But now when I’m using Rails, it seems to me that it doesn’t only manipulate the DOM/Ajax but also the language itself.
Example: http://api.prototypejs.org/language/hash/
It was a long time ago I used jQuery, but I recall that the framework didn’t have these features right?
Is this a good feature for Rails developers, having the same language convention to on the Javascript side?
Share your thoughts Rails developers!
With comparison to other frameworks, jQuery is pretty much just for DOM manipulation. Whereas the others are about providing a framework of objects to your disposal.
The Hash object you mentioned in your question is something which just has the same functionality as any javascript object. MooTools and Prototype like to give them special names (for some good reasons – as extending the Object prototype can cause a lot of code to fall down if you are using for in without a hasownproperty check).
Whether or not one is right for a project is up to you, it’s all about preference. MooTools and Prototype are about extending the Javascript language. Whereas jQuery is about creating a super object that has the same features. This is why jQuery has soo many plugins, and why
$.fnis used for most of them, instead of working with prototypes – and probably why jQuery is easier for beginners (they don’t have to know how javascript works).Anything you can do in one framework, you can do to another, as there is nothing stopping you from doing it yourself, or sticking something from say MooTools which you like into jQuery.