As Rails users we are well familiar with script.aculo.us and the Web 2.0 coolness that is pretty much built in to Rails.
Standard Web 2.0 coolness done better
To be frank, our js framework of choice is actually jQuery. We prefer the lighter weight, power and general betterness.
Show stopper?
Thing is, we've found a few negative points of using both jQuery and script.acol.us together:
- Heavier pages due to more libraries
- Slightly mitigated through packing and caching
- Not working nicely together
- Having to use noconflict
var J = jQuery.noConflict();
- A minor inconvenience really...
- Mixing frameworks is just plain messy
All is not lost
So, we've elected to use jRails. We now use only one js framework resulting in lighter, cleaner and nicer Web 2.0 apps. No changes are required to most .rjs scripts and you still get pretty much all the functionality required from script.aculo.us.
Minor gotcha
We did find a slight omission however. Where script.aculo.us Ajax calls use
loadingto prescribe Ajax loading behaviour, jQuery uses
beforeSendThis is not supported in the current
options_for_ajaxWe have been in touch with Aaron and hopefully a fix will be posted...Till then, here's a patch:
options_for_ajax
.
.
.
js_options['beforeSend'] = "function(xhr) {xhr.setRequestHeader('Accept', 'text/javascript'); #{options.delete(:loading)};}"
Of course, if you're using Piston, you'll be fine.
p.s.
More news soon on Moneyspyder's newest clients and work...!
No comments:
Post a Comment