Json encode data looping in js
<p>I have data that php returned to JS but i dunno how to loop it to access the information... i have this:</p>

<pre><code>    result = call_data('get_chat.php');
            console.log(result);
    for(var data in result){

        alert(result[data]["id"]); //says undefined

    }
</code></pre>

<p>Console Log shows:</p>

<pre><code>   [{"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"}]  
</code></pre>

<p>So i want to loop each data from it but how do i do it im really confused!! It just says undefined each time.</p>
