implement inheritance by object masquerading
文章來源:365jz.com 點(diǎn)擊數(shù):
152 更新時(shí)間:2009-09-13 10:37
參與評(píng)論

Code
<script language="javascript" type="text/javascript">
function clsA(){
this.color="red";
this.sayColor=function(){
alert(this.color);
}
this.sayColorAgain=function(){
alert(this.color);
}
}
function clsB(){
this.color="green";
//this.prox=clsA;
//this.prox();
//delete this.prox;
//clsA.call(this);
clsA.apply(this);
}
var clsb=new clsB();
clsb.sayColor();
clsb.sayColorAgain();
</
如對(duì)本文有疑問,請(qǐng)?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會(huì)為你解答?。?點(diǎn)擊進(jìn)入論壇
------分隔線----------------------------