I have the following code snippet:
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();
However, when I try to call anotherBFunc, it fails. Can anyone help me understand why this is happening?