This is a basic javascript question about accessing rows and fields in a variable reference that has json data in it.
I have been told that I need to access the data out of a json string but I am not having any luck...my two alerts are blank...
Here is the code I am testing with:
<body>
<script>
var data = '[ {"comp_id": "190753","comp_name": "ABC Limited"},{"comp_id": "343838","comp_name": "Adams Company"} ]';
// how many rows?
alert(data.rows);
// the comp_name field on the first record?
alert(data[0].comp_name);
</script>
</body>
Please help.
Thx Scott