What is the difference between Zepto and jQuery 2?

前端 未结 6 501
情话喂你
情话喂你 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:37

    This is a somewhat old question, but I would like to add performance. From what I'd heard, Zepto performed better than jQuery.

    This jsPerf shows different results. I can use jQuery's class selection (of a single element) 137% as often, compared to Zepto's. For ID selection, I can use jQuery's 285% as often.

    That's a huge deal considering on most applications, DOM interactions are the only performance statistic that matters (other than network requests).

    Also looking at that perf, I can see that I could do document.getElementsByClassNAme 8326% as often as jQuery, so we should all ditch all of these if possible :-)

提交回复
热议问题