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
};
以上就是该版本的jQuery的原型上的部分属性和方法.
selector:用于记录init参数的selector.但不一定是相等的.
$("div").selector;//"div"
$("div").find(p).selecctor;//"div p";
这个属性一般用于调试.
jquery:jQuery的版本号.
length:元素的个数.
size():等效于length,length的内存开销更小.
剩下的成员在后面的章节中介绍.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn