Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by ehutch79 on Monday January 16, 2012 @11:05AM
(#3471084)
does anyone know if it's compatible with backbone like zepto can drop in and replace jquery on mobile?
[ Parent
| on HN ]
Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by davej on Monday January 16, 2012 @11:41AM
(#3471291)
It 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.
Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by crescentfresh on Monday January 16, 2012 @01:00PM
(#3471679)
Does backbone use .data()?
Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by davej on Monday January 16, 2012 @02:32PM
(#3472080)
Actually, 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#L3...
Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by werencole on Monday January 16, 2012 @11:06AM
(#3471089)
The idea is to drop in and replace jquery on mobile.
Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by untog on Monday January 16, 2012 @11:26AM
(#3471197)
The idea is, sure, but can it? Zepto is supposed to be a drop-in replacement too, and it definitely isn't.
Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by tomkr on Monday January 16, 2012 @11:33AM
(#3471238)
The 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.
Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by werencole on Monday January 16, 2012 @11:32AM
(#3471232)
Well, as an observer of these things, sign up for the beta and let me know how it works out.
Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by untog on Monday January 16, 2012 @11:40AM
(#3471276)
Mostly 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.
Re:JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery...
by davej on Monday January 16, 2012 @11:49AM
(#3471345)
> 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.