My code looks like this:
function A() {
this.AFunction = function() {
var b = new B();
b.BFunction();
}
}
function B() {
this.BFunction = function() {
// some code
$.ajax({ url: url
success: BSuccess,
// and so on
})
}
this.BSuccess = function() {
// some code
this.anotherBFunc();
}
this.anotherBFunc = function() {
// some code
}
}
a = new A();
a.AFunction();
And it fails on the calling anotherBFunc. Could please some one help me understand why does it happed?