I have data that php returned to JS but i dunno how to loop it to access the information... i have this:
result = call_data('get_chat.php');
console.log(result);
for(var data in result){
alert(result[data]["id"]); //says undefined
}
Console Log shows:
[{"eventtime":"0000-00-00 00:00:00","message":"test2","bywho":"dave","id":"2"},
{"eventtime":"0000-00-00 00:00:00","message":"testttt","bywho":"dave","id":"1"}]
So i want to loop each data from it but how do i do it im really confused!! It just says undefined each time.