Neethu
Neethu

Reputation: 85

How to parse [object object] array in jquery

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

Answers (1)

Pranav C Balan
Pranav C Balan

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

Related Questions