hsy541
5 Aug 2007, 6:05 AM
I'm a newbie to javascript. So please help me to check this
I wrote a class like this
MyClass = function(options){
this.url = options.url;
this.params = options.params;
this.logDivEL = options.logDiv;
this.autoRefresh = true;
this.keepMoniter = function(){
Ext.Ajax.request({url:this.url, params:this.params, callback: this.moniterHandler});
};
this.moniterHandler = function(ooptions,success,resp){
alert(this.logDivEL);
if(success)
this.logDivEL.innerHTML=this.logDivEL.innerHTML+resp.responseText;
};
}
When i run it in firefox it tells me that the logDivEL is undefined
I wrote a class like this
MyClass = function(options){
this.url = options.url;
this.params = options.params;
this.logDivEL = options.logDiv;
this.autoRefresh = true;
this.keepMoniter = function(){
Ext.Ajax.request({url:this.url, params:this.params, callback: this.moniterHandler});
};
this.moniterHandler = function(ooptions,success,resp){
alert(this.logDivEL);
if(success)
this.logDivEL.innerHTML=this.logDivEL.innerHTML+resp.responseText;
};
}
When i run it in firefox it tells me that the logDivEL is undefined