Mastering jquery's Selector

Source: Internet
Author: User
Tags gettext

The selector can be traced to at least the CSS selector. jquery's source code is embedded in a named Sizzle object, in fact, is the selector. In the JQuery official online show sizzle belongs to "other jQuery Foundation Projects", sizzle can be independent for a separate project, thus it is not difficult to realize the importance of the selector. Look at the following three pages, by contrast, jquery chooses the organ-side document to look the most "messy".

Http://www.w3.org/TR/css3-selectors   
CSS Selector standard document   
        
https://github.com/jquery/sizzle/wiki/ Sizzle-documentation   
Sizzle document   
        
http://api.jquery.com/category/selectors/   
jquery Select Organ side document

jquery1.9.0 source code has this line:

Jquery.find = Sizzle;

Importing Jquery.js and sizzle.js, you can see that jquery.find and sizzle are really the same thing.

Ijs.showobjectnames ("Window.jQuery.find");     
Ijs.showobjectnames ("window.") Sizzle ");
    [Object] Window.jQuery.find
|--[function] attr
|--[function] Compile
|--[function] Contains
|--[function] Error
|--[function] GetText
|--[function] Isxml
|--[function] Matches
|--[function] Matchesselector
|--[function] Setdocument
|--[function] Uniquesort
|--[object] Selectors

[Object] window. Sizzle
|--[function] attr
|--[function] Compile
|--[function] Contains
|--[function] Error
|--[function] GetText
|--[function] Isxml
|--[function] Matches
|--[function] Matchesselector
|--[function] Setdocument
|--[function] Uniquesort
|--[object] Selectors

Since sizzle claims to be "supports virtually all CSS 3 selectors", it might be a good idea to refer to the following list of the documents and find a better piece of the document (click on the link to see the grammatical details), isn't it?

(Note: This table is always a display problem, so the HTML code is edited, one of the Replacements is (<a\shref= "[^" >]* ">) [^<]* (</a>) replaced by $ $)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.