I have this simple class :
class myCustomClass{
foo(value){
//do some stuff
}
faa(){
//do some stuff
$.getJSON( someUrl, function(data) {
// how call the method foo(value) here ?
this.foo('fii'); // error occured here, because 'this' is not in 'class' context
}
}
}
How can I use the method 'foo(value)' in the method faa when I use an AJAX statement ? I can't use a simply 'this.foo(value)' here because the context of 'this' in the AJAX statement isn't the 'class' context (but the AJAX context)