Hi folks,
I figured out the problem I was having with CFJson.
Thanks,
Chris
Christopher Jordan wrote:
Does anyone on
the list have experience working with CFJson? I'm trying to use it for
the first time, and I'm having trouble.
I've got a CF template that builds a query (manually) which has two
fields (CellID, and CellValue). I get the string
back on the client side JSon encoded and it looks like this:
{"recordcount":9,"columnlist":"CELLID,CELLVALUE","data":{"CELLID":["172104_PDPending","172104_PDOpen","172104_PDAssigned","172104_PDConfirmed","172104_PDTotal","172104_TROpen","172104_TROffered","172104_TRSubmitted","172104_TRTotal"],"CELLVALUE":[1,0,0,0,1,3,0,2,5]}}
I then eval the JSon string like this:
var test = eval("(" + r + ")");
If I then inspect the object "test" using a tool a friend of mine
wrote, all I see is this:
Displaying Object: [object Object]
columnlist = CELLID,CELLVALUE
recordcount = 9
I don't understand what I'm doing wrong. I thought at first
that
it might be the version of CFJson, and it turned out that CFLib.org was
hosting an old version of the code. So I got the newest version from
the developer's site and there's no change. The JSon encoded string
above was generated using the newest version.
Does anyone have a clue as to what I'm missing here?
|