如何在jquery中解析[object object]数组

时间:2015-09-16 10:07:30

标签: jquery

将[Object,Object]作为控制器的结果。如何在$.each(data, function (index, el) {}

中获取ID和标题的每个值?
[Object, Object]

0:Object
ID: 9
title: "15Sep2015"

1: Object
ID: 15
title: "rrr"

1 个答案:

答案 0 :(得分:2)

你可以做到

$.each(data, function (index, el) {
   var id = el.ID , // or el['ID']
       title = el.title ; // or el['title'] 
});

参考: Property Accessors