亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

prototype class詳解

 更新時間:2006年09月07日 00:00:00   作者:  
//香水壞壞 06-07-19 TKS:林子,給大家提供一個交流分享的地方
var Class = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }
}
可以改寫如下:可能會看的更明了:
var Class={
    create:function(){
      return cls_initfunc
  }
}

var cls_initfunc = function()
{
    this.initialize.apply( this,arguments );  
}

//如上Class對象的create方法顯然返回的是一個對象構(gòu)建函數(shù)
//同時在構(gòu)件函數(shù)里執(zhí)行this.apply方法初始化對象
//this參數(shù)是用來替換的對象,arguments是initialize函數(shù)接受的參數(shù),通過執(zhí)行      

//下面,我給出更簡單的模型
var obj = function()
{
   this.initialize.apply(this, arguments);
}
obj.prototype={
initialize:function(){
  //do ur init in here
},
<field>,
<menthod>
}

相關(guān)文章

最新評論