I am using a php to form a json object from sql and using json_encode($myarr) which is working perfectly.
in my javascript i am using a util function to get the json which is also working fine.
var get_schedule_service = webservices.get_schedule + "/" + 0;
generic_get(get_schedule_service, function(response) {
if (response) {
console.dir(response);
} else {
alert('empty schedule');
}
});
the above code outputs the proper json.
The problem i am facing is when i try to store the output in a javascript var i get an error that the var is undefined.
i have also tried putting the entire webserice in an array something like this:
var get_schedule_service = webservices.get_schedule + "/" + 0;
var my_json_array = generic_get(get_schedule_service, function(response) {
if (response) {
return response;
}
});
generic_getdo?ajaxthing, assuming so, then it will not be having value on the immediate step as this will be asynchronous.. You need to make use ofdeferredandpromiseobject here.generic_get? Please, provide the full definition (the full code).