I have a Bar class:
function Bar() {
this.myMethod = function() {
$.ajax({
...,
success: function(msg){
// I can't get Bar instance with 'this'
}
});
}
}
If ajax is succeeded, I want to do something with Bar instance. What should I do? Create var for the instance outside ajax call?
1 Answer