I have an AJAX callback which is supposed to return an entry value for each row in an array
$.ajax({
url: url,
datatype: JSON,
success: function(data){
$.each(data, function (key, value){
alert(key + ': ' + value);
});
},
error: function(){
alert('There was an error loading your request. <br />Please try again later.');
}
});
Instead of doing an alert() for each entry, it’s doing an alert() for everything single character in the array. It’s as if it’s drilling down one dimension too far.
That means your date is not being converted into json, it’s looping over the characters in the response string. Verify that data is what you think it is.
I suspect
datatypeneeds to bedataType, and the value for that parameter needs to be “json”