Vi. jQuery source code analysis: jQuery prototype attributes and Methods

Source: Internet
Author: User

        97      jQuery.fn = jQuery.prototype = {        98      constructor: jQuery,        99      init: function( selector, context, rootjQuery ) { },         210     selector: "",                213     jquery: "1.7.2",                216     length: 0,                219     size: function() {},        223     toArray: function() {},                229     get: function( num ) {},               241     pushStack: function( elems, name, selector ) {},               270     each: function( callback, args ) {},        274     ready: function( fn ) { },        284     eq: function( i ) {},        291     first: function() {},        295     last: function() { },        299     slice: function() {},        304     map: function( callback ) { },        310     end: function() { },               316     push: push,        317     sort: [].sort,        318     splice: [].splice        };

The above are some attributes and methods on the prototype of jQuery of this version.
Selector: used to record the selector of the init parameter. but not necessarily equal.
$ ("Div"). selector; // "div"
$ ("Div"). find (p). selecctor; // "div p ";
This property is generally used for debugging.
Jquery: jQuery version number.
Length: number of elements.
Size (): equivalent to length, the memory overhead of length is smaller.
The remaining members will be introduced in the following sections.

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.