You need to save the link for this value from the parent scope:
var parentScope = this;
and then access to functionToCall through this object
parentScope.functionToCall();
Example:
function outerClass() { var parentScope = this; this.functionToCall = function() {
Another way to achieve this would be to use Es5 .bind() to set the this value inside your internal function (-context)
$.ajax({ success: function() {
source share