I'm pretty new to JSON and jQuery. I have a JSON file from a url and the format is this:
{
"united":[
{"Atlanta","California","Alabama"}
]
"canada":[
{"Ontario","British Columbia"},
]
}
What I'd like to do is when a user selects a country from a list, I would just like to parse out the array specific to the country.
What I have is this so far:
function getUrl(country) {
alert(urlBase + countrylist);
$.getJSON(urlBase + countrylist, function(data){
$.each(data, function (index, value) {
alert(value);
});
});
}
The alert of value is not being triggered so it doesn't seem to be going inside the each statement.