jQuery实现笔记1-构造器

function jQuery(){

  return new jQuery.prototype.init();


}

jQuery.prototype.init = function(){

  console.log("initializing");
}

jQuery.prototype.css = function(){
  console.log("css");
}

jQuery.prototype.init.prototype = jQuery.prototype;

 

var testJ = new jQuery();
testJ.css();

 

posted @ 2015-12-17 10:06  我是魏星星  阅读(126)  评论(0编辑  收藏  举报