I'm trying to loop thru my nested array of json objetcs..
Here's the loop:
$("#test").text("");
for(var i=0;i<obj.length;i++){
$("#test").append(obj[i].line_item + ", ");
for(var j=0;j<obj[i].length;j++){
$("#test").append(obj[i][j].iid + ", ");
$("#test").append(obj[i][j].name + ", ");
$("#test").append(obj[i][j].price + ", ");
$("#test").append(obj[i][j].lid + ", ");
$("#test").append(obj[i][j].picture + "<br />");
}//for for
}//for
console.log i showing no errors, when i echo the php-script I get this output:
[{"line_item":"base","0":
{"iid":"1","name":"mix","price":"30","lid":"1","picture":"images\/mix.jpg"},
"1":{"iid":"2","name":"green","price":"30","lid":"1","picture":"images\/green.jpg"}}]
The problem: When I loop thru the arrays i only get the output: base, in my html file.
My question: How can i get hold of the inner array objects?