Can anyone please tell me how I can access this JSON data with JavaScript? I tried it wit the $.each loop, tried accessing with [0] but everything returned undefined.
JSON data from controller:
{
"workers": {
"107": "Lisa",
"96": "Marvin",
"24": "Michael",
"23": "Patrick",
"116": "Peter"
}
}
Ajax Call:
$.ajax({
url: '/cake/workers/getWorkersAsJSON.json',
async: true,
success: function(data) {
// process
}
});