jquery框架研究

上代码

var $ = jQuery = function() {
    return new jQuery.fn.init();
};


jQuery.fn = jQuery.prototype = {
    init: function(args) {
        this.length = 0;  //修改length
        this.test = function() { //添加test方法
            return this.length;
        };
        delete this.jquery;  //删除jquery属性
         
        return this;  //指向jQuery实例     
    },
    jquery: '1.3.2',
    length: 1,
    size: function() {
        return this.length;
    }
};
jQuery.fn.init.prototype=jQuery.prototype;
原文地址:https://www.cnblogs.com/ylkk/p/2649922.html