I followed the debugger and I am receiving data from my server but the objData variable is always undefined when pass the data from the GetAjax function to the GetPlacesAroundMe.
As you can see I set the ajax to be sync.
*The code is added below
Thanks, I will appreciate any help.
Model.prototype.AjaxGet = function(sUrl,sData,sType){
var result="";
$.ajax({
url: sUrl+"?"+sData,
type: sType,
async: false,
success: function(data){
return (data);
},
error:function(exception){
alert(exception.responseText);
}
});
//return result;
}
Model.prototype.GetPlacesAroundMe = function(data){
var objData = this.AjaxGet(ip_address+"/purpleserver/index.php/selectController/GetPlacesAroundMe",data,"get");
return objData;
}