JQuery prototype properties and methods for jQuery learning notes
- 2020-03-30 03:14:58
- OfStack
jQuery.fn = jQuery.prototype = {
constructor: jQuery,
init: function( selector, context, rootjQuery ) { },
selector: "",
jquery: "1.7.2",
length: 0,
size: function() {},
toArray: function() {},
get: function( num ) {},
pushStack: function( elems, name, selector ) {},
each: function( callback, args ) {},
ready: function( fn ) { },
eq: function( i ) {},
first: function() {},
last: function() { },
slice: function() {},
map: function( callback ) { },
end: function() { },
push: push,
sort: [].sort,
splice: [].splice
};
These are some of the properties and methods on the prototype of this version of jQuery.
Selector: the selector used to record init arguments. But not necessarily equal.
$(" div "). The selector; / / "div"
$(" div "). The find (p). Selecctor; / / "div p";
This property is generally used for debugging.
Jquery: the version number of jquery.
Length: the number of elements.
Size (): equivalent to length, which has less memory overhead.
The remaining members are described in a later section.