I have object myObject, inside I have function execute(), inside I have $.ajax({ which have complete: function(xmlHttp){. Inside that function I want to call setResult which is defined in the myObject. How to do that?
function myObject() {
this.setResult = setResult;
function setResult(result) {
this.result = result;
}
function execute() {
$.ajax({
complete: function(xmlHttp){
(?) setResult(jQuery.parseJSON(xmlHttp.responseText));
}
});
}