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

JS 繼承實(shí)例分析

 更新時(shí)間: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 還是來(lái)點(diǎn)實(shí)際的吧...
復(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)文章

最新評(píng)論

本溪| 乌兰县| 博湖县| 金川县| 开鲁县| 镇江市| 南康市| 汝城县| 西安市| 巴楚县| 高雄县| 丰宁| 龙里县| 准格尔旗| 宜宾市| 新安县| 全椒县| 库车县| 吴堡县| 岳阳县| 孝义市| 台中县| 马尔康县| 茂名市| 大石桥市| 青龙| 博爱县| 大庆市| 筠连县| 黄龙县| 东方市| 大宁县| 眉山市| 伊宁县| 奉贤区| 昌都县| 车险| 吉水县| 古丈县| 景东| 鄂托克旗|