Reputation: 85
Getting [Object, Object] as the result from controller.How can I get each value of ID and title in $.each(data, function (index, el) {}
[Object, Object]
0:Object
ID: 9
title: "15Sep2015"
1: Object
ID: 15
title: "rrr"
Upvotes: 0
Views: 229
Reputation: 115242
You can do
$.each(data, function (index, el) {
var id = el.ID , // or el['ID']
title = el.title ; // or el['title']
});
Ref : Property Accessors
Upvotes: 2