I've been struggling with this code snippet and despite looking at similar posts, I can't seem to get it right.
var obj2 = JSON.parse('{"venue_data":
{"venue_id":"25",
"description":"Space Cafe",
"venue_type": [
{"type_description":"Cafe"},
{"type_description":"Free Wifi"},
{"type_description":"Hangout"}
]
}
}
');
//the following line is causing issues :(
alert(obj2.venue_data[0].venue_id);
//and so do the next two lines :(
alert(obj2.venue_data[0].venue_type[0]);
alert(obj2.venue_data[0].venue_type[1]);
I've tried various approaches but now I'm just making guesses.
ps...It works fine without the array in the data.
Any assistance would be greatly appreciated.
Thanks,
Ned