Adam Wojda
Adam Wojda

Reputation: 779

Iterate through complicated json object and array

This is my json structure http://www.jsoneditoronline.org/?id=fb2a15d2df238449142d98ad015961f9

I'm trying to loop trough results like this:

        success: function(data) {
            for(var i = 0; i < data.result.length; i++)
            {
                var product = data.result[i];
               alert(product);
            }
        }

Then in this 'result' object I've got another Object in Object and Array, how can I get this value?

enter image description here

Upvotes: 0

Views: 58

Answers (1)

Nitish
Nitish

Reputation: 299

results = data.tw_objects.tw_object.results.result; for (i=0; i<results.length; i++){ console.log(results[i].image.large.url) }

Upvotes: 1

Related Questions