jquery iterate through nested object -


i´m getting data php. parse json

var d = $.parsejson(returndata); 

d.designer looks like:

[object, object, object]   0: object _id: 1  family: null firstname: "xx" lastname: "yy" __proto__: object  1: object _id: 2  family: null firstname: "xx" lastname: "yy" __proto__: object  2: object _id: 5  family: null firstname: "xx" lastname: "yy" __proto__: object 

with jquery how can loop trough objects get:

id: 1 id: 2 id: 5 

where id value key _id ?

you can use each return value , key every element

$.each(d, function( index, value ) {   console.log("id: "+index); }); 

Comments

Popular posts from this blog

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -