I'm using the following code to make an AJAX call:
$.ajax({
url: href,
type: 'POST',
data: {},
dataType: "json",
error: function(req, resulttype, exc)
{
// do error handling
},
success: function(data)
{
for (var tracklist in data) {
console.log(tracklist.name); // undefined
console.log(tracklist['name']); // undefined
}
}
});
What I return to the AJAX request is:
{"5":{"id":5,"name":"2 tracks","count":2},"4":{"id":4,"name":"ddddd","count":1},"7":{"id":7,"name":"Final test","count":2}}
What I would like to know is how to access the name attribute of the current tracklist.