I have the following function:
function getJson() {
$.ajaxSetup({
async : false
});
$.getJSON(baseURL + "/ObterCursos",
function(data) {
$.each(data, function(key, val) {
items.push({
"Codigo" : val.Codigo,
"Nome" : val.Nome
});
});
});
}
The first time it's called, it takes a while to get the results, but the next few times it works quickly. But I discovered that if I compile this code in a Cordova
project, even though it is called again and there are different values being returned from the request, this method does not update the results. What can I do to resolve this?