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

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -