Zepto 只是 jQuery 的子集吗?
让我惊讶的是backbone.js 可以使用jQuery 或Zepto 作为它的“帮助库”。 Zepto 人是如何设法拥有与 jQuery 兼容的语法的? Zepto 只是 jQuery 的子集吗?
I was amazed that backbone.js can use either jQuery or Zepto as its "helper library". How did the Zepto people manage to have a syntax compatible with jQuery's? Is Zepto just a subset of jQuery?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
似乎他们正在努力保持 jQuery 风格语法并提供一个仅包含最有用功能的精简库。
来自: https://github.com/madrobby/zepto/blob/master/README .rdoc
Seems they are trying to keep with the jQuery style syntax and providing a minified library that only includes the most useful features.
From: https://github.com/madrobby/zepto/blob/master/README.rdoc
Zepto 是一个新库,他们的目标是让从 jQuery 的过渡变得容易。
很明显,他们遗漏了许多您可以在 jQuery 中找到的函数来执行此操作。
看起来他们也牢记原型功能。
如果他们选择较小的代码块而不是性能,我也不会感到惊讶,我并不是说这对性能严重不利,或者 jQuery 过于臃肿,而是与 jQuery 最近的前景不同。
Zepto is a new library where their goal is to make it easy to transition from jQuery.
It's obvious they are leaving out many functions you'd find in jQuery to do so.
It also looks like they are keeping prototype functionality in mind too.
I also wouldn't be surprised if they are choosing smaller blocks of code over performance, I'm not saying it's heavily detrimental to performance or jQuery is overly bloated, but a different outlook than jQuery has had lately.