What is the difference between Zepto and jQuery 2?

前端 未结 6 380
情话喂你
情话喂你 2021-02-01 00:21

There are those two similar projects:

Zepto.js

Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API

6条回答
  •  时光说笑
    2021-02-01 00:42

    From what I've read, people seem to lean heavily towards Zepto. The most-common reasoning behind that is file-size, but jQuery 2 is actually faster than Zepto after it is loaded. Also, you won't find much support for Zepto since most people develop around jQuery. I'm not suggesting you shouldn't use Zepto, but you should look into why you want to use it and if other JavaScript libraries you are using support/conflict with it.

    I would say it depends on your project. For personal or limited use, Zepto may be the better option. However, jQuery is much more supported by other libraries and if the file size is the only thing determining your reason then it is flawed. JavaScript should be loaded after the page is loaded, therefore it wouldn't hinder your page load time in either case.

    Here is performance test including jQuery 1.7.2, Zepto 1.0rc1, and also jQMobi 1.03.

提交回复
热议问题