I have this JavaScript object
Object {VoteTag: Object, ResortVoteTag: Array[1]}
ResortVoteTag: Array[1]
0: Object
id: "1"
resort_id: "1561"
tag_id: "4"
user_id: "31"
vote: "3"
length: 1
VoteTag: Object
id: "4"
tag: "Snowboarders"
type: "slopes"
I'm trying to access the vote property in the ResortVoteTag array however I am unable to do so.
This is the following code I'm using.
$.ajax({
url: "/Votetags/alltags",
async: false,
dataType: 'json',
}).done(function ( data ) {
for(var i = 0; i < data.length; i++){
console.log(data[i].ResortVoteTag.id);
}
});
data[i].ResortVoteTag[j].id(wherejis another loop iterator). Your description of the object includes two Array definitions. (though i have to say that way of describing an object is confusing...)donefunction and look at the data you're receiving.