通过将 Sizzle.js 与 jquery1.4.2 一起包含,我可以获得什么好处?
从 jquery.com 下载的最新 jquery 1.4.2 还附带 Sizzle.js。
我可以如何从包含的 Sizzle.js 中获得什么好处?
Sizzle.js 是一个独立的库吗?
为什么它包含在 jquery 库中,目的是什么?
/*!
* jQuery JavaScript Library v1.4.2
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Sat Feb 13 22:33:48 2010 -0500
*/
虽然 sizzle.js 网站上提到了这一点
完全独立(没有库 依赖项)
latest jquery 1.4.2 downloaded from jquery.com comes with Sizzle.js also.
How and what benefit can I take from included Sizzle.js?
Is Sizzle.js a standalone library?
Why it's included inside jquery library, for what purpose?
/*!
* jQuery JavaScript Library v1.4.2
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Sat Feb 13 22:33:48 2010 -0500
*/
while this is mentioned on sizzle.js website
Completely standalone (no library
dependencies)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Sizzle.js 是一个 JavaScript 库,它实现了“旨在轻松放入主机库的 CSS 选择器引擎”。 jQuery 在内部使用它来满足 CSS 选择需求。如果您想要一个 CSS 引擎并且不需要 jQuery 的所有其他 JavaScript 优势,您可以单独使用 Sizzle.js。
Sizzle.js is a JavaScript library that implements a "CSS selector engine designed to be easily dropped in to a host library." jQuery uses it internally for its CSS selection needs. If you wanted a CSS engine and had no need for all the other JavaScript benefits of jQuery, you could use Sizzle.js separately.
好吧,实际上我并不清楚 sizzle.js 是什么。基本上,它的作用是允许您在“选择器”(即类、ID、DOM 元素等)上使用 javascript。
因此,当您在 jQuery 中使用它时:
sizzle.js 正在发挥作用,使该元素可用于 javascript。
我希望我没问题:)
OK, it was actually pretty unclear what sizzle.js was to me. Basically, what it does is allows you to use javascript on 'selectors', that is, classes, IDs, DOM elements, etc...
So when you use this in jQuery:
That's sizzle.js at work, making that element available to javascript.
I hope I got that all right :)
jQuery 需要嘶嘶声才能发挥作用。您可以利用有效的 javascript 库。
jQuery requires sizzle in order to function. You can take the benefit of a working javascript library.
这是相关资源:
http://wiki.github.com/jeresig/sizzle/
选择器功能
代码功能
Here is the resource for that:
http://wiki.github.com/jeresig/sizzle/
Selector Features
Code Features