How to access data outside ajax callback
Hi,
The answer to my question is probably very simple, but I'm having trouble making this work.
I want to access a local csv file, rearrange it into an array, and use the data later in my script. The logic of this in psuedocode is:
var massagedData
$.get("myfile.csv",function(data){
massage the data here
massagedData = the results
});
***Use the massaged data
Since the massaged data are in the callback, they're not available at ***. I've tried declaring the variables outside the callback as shown, but this doesn't seem to work either. I'm thinking there must be an easier way. Is there?