I’m trying to get some json data in my application, but it won’t come in the result function.
function myLoad(){
output.innerHTML = 'in the load';// + items;
var myJsonUrl = 'http://....be/.../lineup.php';
$.getJSON(myJsonUrl, function(data) {
output.innerHTML = "IN THE FUNCTION";
});
output.innerHTML = 'END load';
}
In mu output div I can see ‘in the load’ so it stops at the .getJSON part.
I’ve included the right jquery libraries (jquery mobile and jquery1.4) and the json from the specified url validates.
What am i doing wrong?
EDIT:
In chrome it works sigh.
I was testing it in Eclipse web browser since I’m working for an Android application.
Apperantly that browser s**ks.
Thx for the idea Sir Troll
=> still can’t answer my own question
Are you sure you’re not getting the data? Your example would most likely overwrite END load with IN THE FUNCTION, since the callback will be executed after the function finishes.
So output.innerHTML would get the values like this:
I would suggest trying to output
datain the callback, and remove the innerHTML changes from outside the callback function.