5 ms·
does anyone know if it's compatible with backbone like zepto can drop in and replace jquery on mobile?
by ehutch79 15y ago
does anyone know if it's compatible with backbone like zepto can drop in and replace jquery on mobile?
- werencole 15y agoThe idea is to drop in and replace jquery on mobile.
- untog 15y agoThe idea is, sure, but can it? Zepto is supposed to be a drop-in replacement too, and it definitely isn't.
- werencole 15y agoWell, as an observer of these things, sign up for the beta and let me know how it works out.
- untog 15y agoMostly because it's almost impossible to know. It might work with all of the functionality I use on a normal day, but then I'll try to branch out at some point in the future and discover that it's broken. The developers are the ones who know what functionality is replicated and what isn't- going through myself and testing seems like a huge waste of time.
- davej 15y ago> Mostly because it's almost impossible to know. Not really, just run the Backbone test suite and substitute jQuery/Zepto with JQ.Mobi. It shouldn't pass straight away because I'm pretty sure that JQ.Mobi is missing a couple of the functions required by Backbone (see my post a couple of levels up) but it probably wouldn't be a huge deal to write them yourself.
- deleted 15y ago[deleted]
- tomkr 15y agoThe claim they do not implement the majority of JQuery's APIs, only the most used ones, so I guess it depends on how much of JQuery you actually use.
- davej 15y agoIt might take a bit shimming to get it to work but JQ.mobi supports a lot of the most obvious methods used by Backbone: .bind(), .unbind(), .html(), .ajax(), .append(), .attr(). It doesn't seem to support .delegate() or .data() though, so you would probably have to shim these (and probably a couple of others that I forgot) yourself.
- crescentfresh 15y agoDoes backbone use .data()?
- davej 15y agoActually, you're right, it probably doesn't. I always use Backbone with the backbone.modelbinding plugin, so I forgot that it's not part of the Backbone core lib. edit: Looks like JQ.Mobi does support .data() anyway: https://github.com/appMobi/jQ.Mobi/blob/master/jq.mobi.js#L388 https://github.com/appMobi/jQ.Mobi/blob/master/jq.mobi.js#L3...