I'm trying to assign a JSON array to a variable as follows:
$.getJSON("tljson.json",function(result){
items = JSON.stringify(result);
});
And then calling that variable outside the function:
timeline.draw (items,options);
Using alert (items) inside the getJSON function works, however, outside of the function, it just returns 'undefined'. I thought this would work, as I declared items as a global variable in the getJSON function. What am I doing wrong?