javascript - JSON returning multiple columns, but all values as single string. How do I get matching key-value from array? -
here's problem, make ajax call, response:
$.getjson('fpcustom.cfc?method=getsyscounts',function(data){buildchart(data);}); i json reponse. raw result:
{"columns":["abc","def","ghi"],"data":[[11,27,4]]}" when ask column[0], correct value: 'abc', when ask data[0], whole data string: 11,27,4. think has double square bracket, don't know how fix that.
how data[0], should 11?
for json:
{"columns":["abc","def","ghi"],"data":[[11,27,4]]}" the property data array of arrays.
consider this: data = [a, b, c], a, b , c variables. thing a array, data is.
this way data[0], first element of data array, array.
how
data[0], should11?
the value want in: data[0][0]:
because:
data[0] -> [11,27,4]
then:
data[0][0] -> 11
data[0][1] -> 27
data[0][2] -> 4
Comments
Post a Comment