標籤:c style class blog code java
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 };
以上就是該版本的jQuery的原型上的部分屬性和方法.
selector:用於記錄init參數的selector.但不一定是相等的.
$("div").selector;//"div"
$("div").find(p).selecctor;//"div p";
這個屬性一般用於調試.
jquery:jQuery的版本號碼.
length:元素的個數.
size():等效於length,length的記憶體開銷更小.
剩下的成員在後面的章節中介紹.