Pull APIs Rest and display the data on the screen

1

I can make an ajax for the service and return the data, I can display the first Product object and its properties, but when there is another object inside ProductImage that has more than 5 objects inside, I can not view their data

$.getJSON("http://www.dipes.com.br/web_api/products/9751/", function(data) {

            console.log(data);
            console.log(data.Product.name);

            var output="<ul>";
            for (var i in data.Product.ProductImage) 
            {
                output+="<li>" + data.Product.ProductImage.i.http  + "</li>";
            }
            output+="</ul>";

            $('span').html(output);
        });
    
asked by anonymous 31.05.2016 / 15:58

1 answer

2

The code is wrong. The correct way to display the array inside the object would be:

output+="<li>" + data.Product.ProductImage[i].http  + "</li>";
    
31.05.2016 / 16:09