Problem getting data from JSON file
I think I have a varialbe scope problem here, but I can't figure it out.
What I'm trying to do is extract a piece of data from a JSON file using a variable established earlier in the script as one of the keys.
When I run this script I get the alert that lets me know that the variable "theMappableItem" has been established correctly. I click "OK" in the alert box.
Then in my console (in firebug) I see a line showing that the .json file has been gotten successfully.
Next in the console is an error that says:
theInfo.theMappableItem is undefined
Below is the code snippet. The json info is attached as a txt file. THANK YOU!!
var theMappableItem = noMarks.replace(/\s+$/, '');
alert(theMappableItem);
//AJAX request for theInfo
var theInfo = $.getJSON("http://localhost:8888/hoodie/sites/all/themes/hoodiecharlotte/theInfo.json", initialize);
var hoodLat = (theInfo.theMappableItem.theLat);