I'm pretty new with javascript and I think this is a dumb question but I don't know how to search my issue on google.
I have a "class" like that :
function Myclass(){}
Myclass.prototype.method1() = function(){
whatever.onload = function(){
this.method2();
}
};
Myclass.prototype.method2() = function(){};
My problem is that "this" isn't related to my class anymore. In this anonymous function scope, I can't reach my method2.
How can I solve this issue ?
Thanks for your advices.