您现在的位置: 365建站网 > 365文章 > implement inheritance by object masquerading

implement inheritance by object masquerading

文章来源:365jz.com 点击数:203 更新时间:2009-09-13 10:37

<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();
</

生产内容,同时打通搜索引擎(SEO)与AI搜索引擎(GEO)流量入口的软件! 点击进入365建站器 »

您可能感兴趣的文章