Good afternoon guys, I have a question regarding json,
I have the following json:
{
"jsonrpc":"2.0",
"result":{
"nr":26,
"lista":[
{
"codigo":"2",
"nome":"Pratos Quentes"
},
{
"codigo":"3",
"nome":"Sobremesas"
},
{
"codigo":"4",
"nome":"Bebidas Nao Alcoolicas"
},
{
"codigo":"7",
"nome":"Cocktails"
},
{
"codigo":"10",
"nome":"Cafes"
},
{
"codigo":"11",
"nome":"Consummes"
},
{
"codigo":"12",
"nome":"Porções"
},
{
"codigo":"13",
"nome":"Chocolates"
}
]
},
"id":138827
}
And while trying to browse through the product list, it only loads the last product, this is the code I'm using to go through:
<script type="text/javascript">
var caminho = "http://brunofejesus.pe.hu/categorias.json";
$.getJSON(caminho, function(data) {
for(i in data.result.lista){
$('#gridCategorias').html(data.result.lista[i].nome);
}
});
</script>
here is a print:
Thanks for the help!