jQuery原理(原型)

(function(){ 
  var jQuery = window.jQuery = window.$ = function( selector, context ) {
     return new jQuery.fn.init( selector, context);
  };
  jQuery.fn = jQuery.prototype = {
        init:function(selector, context){
           alert(selector);
        },
      add : function() {
          return this;
        }
   }
   jQuery.fn.init.prototype = jQuery.fn; 
})();   

//$("dd").add();

评论列表

memory
丫头 OSCer 呀!!
2013-01-26 15:02:59