Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How and what benefit can I take by including Sizzle.js along with jquery1.4.2?

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)

like image 647
Jitendra Vyas Avatar asked May 04 '10 04:05

Jitendra Vyas


People also ask

What is sizzle JS used for?

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.

Does jQuery include Sizzle?

Sizzle has received a substantial rewrite to be included with the release of jQuery 1.8.

What is sizzle CSS?

A pure-JavaScript CSS selector engine designed to be easily dropped in to a host library.


2 Answers

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.

like image 115
Raul Agrait Avatar answered Sep 18 '22 15:09

Raul Agrait


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:

$('div')

That's sizzle.js at work, making that element available to javascript.

I hope I got that all right :)

like image 25
Julian K Avatar answered Sep 17 '22 15:09

Julian K