English 中文(简体)
jQueryMobile on Zepto.js?
原标题:

I m wondering if someone has tried already to port jQueryMobile on top of Zepto.js (http://zeptojs.com/) instead of the required jQuery?

问题回答

The main feature of Zepto.js over jQuery is its file size of ~10kb (minified, not gzipped) instead of jQuery s ~80kb. If you were to replace jQuery wuth Zepto.js then you d still have to include jQuery mobile, which weighs in about 95kb (JS & CSS).

  • jQuery and jQuery mobile: 175kb
  • Zepto.js and jQuery mobile: 115kb

You d save about 1/3rd of the download weight (not including HTML, images and other JS), making making a port of jQuery Mobile to Zepto.js unlikely to be worth the time.

Zepto.js currently also only supports WebKit browsers, meaning you d be loosing support of Firefox Mobile and IE7&9 Mobile too.

Update: Zepto now supports a lot more platforms.

dave1010 makes good points.

You may also be interested in a back & forth between the creator of Zepto (madrobby) and jQuery (John Resig) on Hacker News

I think it s simply to early for that. jQuery Mobile hasn t seen an official release yet (only alpha2) and zepto.js is also still in its infancy.

Furthermore, zepto.js states "[...] that emulation of all features of jQuery is not a project goal", they just want to emulate the most useful parts. With this direction it is questionable if zepto.js can ever serve as a drop-in-replacement for jQuery in the mobile context.

However, a possible success of zepto.js could inspire the jQuery team... maybe we will soon see a "jQuery for Chrome Smartphones" build that has all IE/Firefox/Opera stuff compiled out.

jqtouch already support zeptojs, you may want to give it a try.

I started on a web project and I really, rally wanna use Zepto, but the current users developing for Zepto is really low. Not a big community, not to many plugins and I don t see why not using google s CDN for jQuery.

Zepto is great for senior JavaScript developers maybe.





相关问题
JqGrid setCell method, inserts blank row in the grid

I have a portion of code to update a cell value like this: jQuery("#myGridDiv").jqGrid( setCell , myRowToEdit, myColToEdit, myNewValue); that s about it, and sometimes it happens that a blank dummy ...

Jquery calendar and tab sliding div clash

Hey all, I am trying my best to figure out another way around this problem I seem to have encountered. On my website I have a jquery calendar and also a jquery div tab slider (this: http://www.queness....

Fixing a project with multiple Javascript frameworks

I just started a new job, and my first task is to clean up the Javascript code for the site - the problem is that there are two JS libraries being used (jQuery and Prototype / Scriptaculous). I m ...

Promising alternatives for javascript framework? [closed]

Popular JavaScript frameworks/libraries like jQuery, MooTools, Prototype, and YUI (to name a few of the most popular JavaScript frameworks out there) definitely have a solid foothold in the JavaScript ...

Is this scoping possible in javascript?

I am working on a javascript framework. I have several independent scripts that look like this: core.modules.example_module = function(sandbox){ console.log( wot from constructor == , wot); ...

Drawbacks of KSS [closed]

Has anyone here used KSS? KSS is an AJAX framework. KSS has both a client-side Javascript library and server-side support. The client-side Javascript library needs to be included in your page. It ...

热门标签