首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2012-05-08 
superclass.constructor.call(this,config),参数问题JScript codefunction Base(config){this.nameconfig

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……

热点排行