I've seen similar posts to this but I just can't get this piece of code 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"}
]
}
}
');
//next line doesn't work :(
alert(obj2.venue_data[0].venue_id);
//either do the next two :(
alert(obj2.venue_data[0].venue_type[0]);
}
alert(obj2.venue_data[0].venue_type[1]);
I've tries different things but now I'm just guessing.
ps...without the array in the data it works fine.
Any help welcome.
Thanks,
Ned