js 封闭 小结

function aa(){

  this.bb = (function(){alert("测试")});

  this.cc = (function(){alert("测试2")});

}

 

引用的时候

new aa().bb();

new aa().cc();

 

或者是

var AA = new aa();

AA.bb();

AA.cc();

posted @ 2013-01-31 17:26  镇水古月  阅读(135)  评论(1编辑  收藏  举报