读书人

superclass.constructor.call(this,co

发布时间: 2012-05-08 22:09:41 作者: rapoo

superclass.constructor.call(this,config),参数问题

JScript code
function Base(config){        this.name=config.name;        this.age=config.age;        this.password=config.password;    }    function base(config){        this.a=config.a;        this.b=config.b;        this.c=config.c;        base.superclass.constructor.call(this,config);//第一个参数this是什么意思?不太明白    }    Ext.extend(base,Base,{        showMessage:function(){            window.alert("name="+this.name+" a="+this.a);        }    });

大哥大姐们,说明一下

[解决办法]
探讨
JScript code

function Base(config){
this.name=config.name;
this.age=config.age;
this.password=config.password;
}
function base(config){
this.a=config.a……

[解决办法]
改变作用域,参考
JavaScript变量函数预编译与执行顺序的关系
[解决办法]
探讨
引用:
比如
var a = new base();

那个this就是a对象~·

我是说这个里为什么要用THIS,不是不知道this代表什么

[解决办法]
探讨
JScript code

function Base(config){
this.name=config.name;
this.age=config.age;
this.password=config.password;
}
function base(config){
this.a=config.a……

读书人网 >JavaScript

热点推荐