Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
jRails - jQuery on Rails (ennerchi.com)
19 points by luccastera on Nov 21, 2007 | hide | past | favorite | 9 comments


Looks great. I've admired jQuery from afar since watching John Resig's talk on it a few months ago (links below).

One thing I'd love to ask those of you who have used both js libraries: Other than the file size difference, what do you see as the main advantages of jQuery over prototype/scriptaculous?

John Resig Part I: http://video.yahoo.com/video/play?vid=410472

John Resig Part II: http://video.yahoo.com/video/play?vid=412541


For me it's all down to philosophy. Prototype adds a bunch of global variables and extends loads of built-in ojbects. That's fine, unless you ever want to include code that has a different idea about how any of those extensionss should work (like mooTools, which I also avoid on philosophical grounds). jQuery adds just one global variable (called jQuery) along with a revertible alias (the $ symbol). That pretty much guarantees jQuery will work flawlessly with any other code.


newer versions of jquery also allow you to clean up the one global variable it adds, afaik, moving it to a location of your choosing. it's very clean.


i thought one of the big advantages of jQuery was the smaller size of the javascript file(s).

but this demo uses 106k of javascript (and it's not compressed for some reason)

photo from web developer extension: http://myskitch.com/michelson/document_size_-_http__ennerchi...


The base jQuery is very light, perhaps half the size of Prototype if I recall correctly.

The added bloat comes from the effects and UI libraries. The UI library is probably superfluous so that should cut the size significantly.


I haven't seen where Rails natively supports using different Javascript files in production than in development -- I've always done it myself. Then again, jQuery hasn't been attached to Rails before, so that's understandable too.

Without that being set up, either you run on the minified version of jQuery (a developer-hostile move), or the big old version with all the comments, which is inconvenient for the user. For a 0.1 release, they made the right call putting in the full versions of the Javascript so you have a chance of seeing what's happening if something goes wrong.


I've moved from prototype to jQuery - I highly recommend it.


but will it blend?


I think I will use this, thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: