I'm trying to walk through a array de objetos
with jquery I'm doing this:
$.getJSON('http://localhost:8000/produtos', function(data) {
$(data).each(function (item) {
console.log(item);
$('.product-slider').append(item.NmProduto);
});
console.log(data);
});
At first console.log(item)
is exiting 0 1 2 3
.
In the command $('.product-slider').append(item.NmProduto);
is not doing anything and if I log console in item.NmProduto
out undefined
, already in my console.log(data)
the right information is coming like no in the following print:
I need to set an html in this div
my with data coming from json
, what is the best way to develop this?