jQuery.fn 为一个对象的话 对象的其中一个方法的原型 是对象自己 而且new jQuery对象为什么非要套在 jQuery.prototype里面其中的一个方法init上来做构造,用个其他的函数是不是更清晰些 ?
function F(selector, context, rootjQuery){
return this;
}
F.prototype={
each:function(){
},
....
}
};
var jQuery = function( selector, context ) {
// return new jQuery.fn.init( selector, context, rootjQuery );
return new F( selector, context, rootjQuery );
}
这样是不是更清晰一些?