I am trying to append data that gets returned from a ajax call. I have the ajax call working correctly. However the data returned is one giant character array. I am using grails MVC, and the value I am returning is a ArrayList. I want to be able to run a for loop that will go through the items. But in order to do that I want to know if there is a way to convert 'data' into an array. The output is shown below.
function getAllActivitiItems() {
console.log ("Starting function");
$.ajax({
url: '${g.createLink(controller: 'Activiti', action: 'getAllActivitiQueue')}',
type: 'POST',
success: function(data) {
console.log("Made it! "+data);
},
error: function(data) {
console.log(data);
}
});
}
AJAX return data value:
[
['userId':'FP301', 'taskId':'1', 'storeKey':'001E0', 'callKey':'12634'],
['userId':'TS206', 'taskId':'2', 'storeKey':'00IAC', 'callKey':'12758'],
['userId':'SN304', 'taskId':'3', 'storeKey':'00IAC', 'callKey':'09843']
]