var list = new Array();
$.getJSON("json.js", function(data) {
$.each(data, function(i, item) {
console.log(item.text);
list.push(item.text);
});
});
console.log(list.length);
list.length always returns 0. I've browsed the json in firebug and it well formed; everything looks fine. I just can't seem to add an item to the array. What am I missing?
Thanks, Nathan