最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

JS 繼承實例分析

 更新時間:2008年11月04日 12:21:19   作者:  
主要有三種方法: 1. this.method=Parent; this.method=Parent's constructor 2. Parent.call(this,arg,arg,arg.....);3.Parent.apply(this,arg.arg...) //for Array 還是來點實際的吧...
復(fù)制代碼 代碼如下:

function P(name){
this.name=name;

this.p1=function(){
alert('Parent Constructor');
}
return this;
}
function C(name,id){
//this.method=P;
//this.method(name); //1st method
//P.call(this,name); //2nd method
P.apply(this,new Array(name));//3rd method
this.id=id;
this.dis=function(){
alert(this.name);
}
}
function dis(){
alert(this.name);
}
function t(){
var cc=new C('N','Id');
cc.dis();
cc.p1();
}

相關(guān)文章

最新評論

龙泉市| 龙山县| 汤原县| 格尔木市| 博野县| 周至县| 修武县| 湘阴县| 永修县| 依兰县| 永修县| 环江| 建昌县| 林州市| 五台县| 开鲁县| 孟津县| 河间市| 广河县| 中方县| 正蓝旗| 徐水县| 盐亭县| 阿拉善盟| 韶山市| 万荣县| 浦城县| 青龙| 泰和县| 临潭县| 河北区| 博客| 临汾市| 长子县| 新野县| 保山市| 桓仁| 耿马| 凤城市| 呼伦贝尔市| 云南省|