Hi, your CFC should just simply return the array and there's no need for
#serializeJSON(data)#, so assume you're populating the array correctly just do
<cfreturn data />
Then modify your ajax statement to something like the following:
$.ajax({
type: "get",
url:"data.cfc?returnformat=json,
data: { method: "GetData" },
cache:false,
normalizeJSON: true,
success: function(res) {
var data = JSON.parse(res);
//loop thru data
for(var i=0; i<data.DATA.length; i++) {
// access each element like data.DATA[i][0]
}// end loop
}// end success
}); // end ajax call
I've taken this from a working example so it should work, again assuming your
array in your CFC is populated correctly.
hope it helps
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360218
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm