[jQuery] Using jQuery to access the JSON that ColdFusion8 returns?
I'm using jQuery to make a direct call to a ColdFusion 8 CFC, with the
optional returnFormat parameter.
Here's the get call:
--------------------
$.get("coupons.cfc?method=getSingleCoupon", {
couponid: couponid,
siteid: siteid,
returnFormat:'JSON'
},function(d){
// alert(d['DATA'][0][0]);
console.log(d);
$container.css({
'background-image': 'none'
});
});
Here's the result when I log to the console:
------------------
{
"COLUMNS":["ID","TITLE"],
"DATA":[
[4,"15% Off A Timing Belt Package"]
]
}
So it's an object with an array named COLUMNS, and one named DATA. I should
be able to reference the title like so:
d['DATA'][0][1];
But when I do so in Firefox, using Firebug I get the error:
d.DATA has no properties
coupons.js
Line 68
What am I doing wrong?