var jquery = function(selector, context){
return new jquery.fn.init(selector, context);
}
jquery.fn = jquery.prototype = {
init: function(selector, context){
this.dom = document.querySelector(selector);
}
}
// 将原型绑定回来
jquery.fn.init.prototype = jquery.fn;
jquery无new构造
最新推荐文章于 2024-06-23 04:44:27 发布