Here's my script which I type into Firebug:
var jsonData;
$.getJSON("./js/ohno.JSON",function(data){
jsonData = data;
});
console.log(jsonData);
Here's the .JSON file contents:
{"oh":"no"}
The first time I run the script in Firebug, it returns "undefined"
The second time I run it (without refreshing the page) it returns the Object.
If I refresh, the same thing happens -- first time running returns "undefined", and second time running it returns the Object.
The .JSON file is
How do I make it so that it returns the Object the first time I run the script?