How to properly parse Result Array from database with Jquery?
<p>I have codeigniter application which fetches data from database and this data is manipulated by Jquery. Result array from database used to look like this:</p>

<pre><code> { "result":[
    {"name":"John","surname":"Smith"}] }
</code></pre>

<p>And I use to parse it using code below:</p>

<pre><code>$.get("index.php/getResult",{f_name: $('#fn').val()} ,function(data) {
    var list= "";
    $.each(data, function(index, element) {
        if (index &gt; 0) {list;}
        list+= element.name;
    });
    $('#myid').html(list);
},"json");
</code></pre>

<p>My result array has changed to the format below, how can I parse it now? Any help is appreciated.</p>

<pre><code>{
"count": 8,
"result":[
{"name":"John","surname":"Smith"}] }
</code></pre>
