PHP json_encode as AJAX var "result":
[{"id":"139","assettypeid":"3","name":"skin1","body":"skin1.jpg"}]
I'm trying to access each property, but I can't:
for (var i =0;i < result.length-1;i++)
{
var item = result[i];
console.log (item.id + item.name + item.body);
}
All I see is:
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
...
And there are way too many iterations ... as you can see in the JSON above, there should only be 4 loops.