“I’m trying to make an Ajax call
, which is successful. But when I try to print the response it does not concatenate the "success" or "failure: string with "initial value"
it prints the middle vale and Also, if i put console.log
inside success or failure it prints the value. It does not work outside the Ajax call
loadData : function(groupRID, serviceName) {
var html = 'initial value';
var params = {
codeGroupRid : groupRID,
outputFormat : 'json'
};
html +=' middle'
Util.Functions.eAjax(serviceName, params, {
success : function(response) {
html += ' Success';
return html;
},
failure : function(errMsg) {
html += ' Failure';
return html;
}
});
},
Expected is - initial value middle Success
Actual is - initial value middle