Don't make it duplicate please. I am in middle of a big problem. I am working on a javascript code with thousands of lines of code. My problem is:
methodA is called from its own class.
methodA{
doSomething(abc, def, function(obj){
obj.getName();
});
}
doSomething(abc, def, callback){
// codes....
callback(new XYZ());
}
In XYZ class constructor I am using a couple of Jquery Deffered objects(with ajax calls). So my problem is at obj.getName()
I am getting error that this.name
is not defined. So how can I ensure that entire new XYZ() execution ends completely(all ajax calls, callbacks etc.) when the control comes to obj.getName()
function ?
Thanks