Visual Basic .NET » ASP.NET General Discussion
callback function inside a class -- strambo --


Hi to all,
i need to know if it's possible do this.

classType={
varValue: 1,
callback:function(AjaxResponse){
alert(this.varValue); //at this moment this alert say
"undefined"
}
}

myClass= new classType();

namespace.function(myClass.callback);

I need to alert the value of varValue.

-- AlbertWeinert --


strambo schrieb:

i need to know if it's possible do this.

classType={
varValue: 1,
callback:function(AjaxResponse){
alert(this.varValue); //at this moment this alert say
"undefined"
}
}

myClass= new classType();

namespace.function(myClass.callback);

namespace.function(myClass.callback.bind(myClass)); 


--
Freundliche Grüße

Albert Weinert

http://der-albert.com 

-- strambo --


Really tnx... it work!

[Submit Comment]Home