I have a function which returns data:
function getData(){
return {result:[{},{},{}...]};
}
This function worked perfectly. Now I want to generate the data dynamically. I use the following method to generate the data, however it does not work out then:
function getData(){
$.ajax({
//...
async: false,
success: function(data, textStatus, jqXHR){
return {result:[{},{},{}...]};
}
});
}
Can some provide me some hints for this or point me to the right direction to do it? thank you.