if you select "Time", the result is an array, like:
[[{
"term": "Dec 9",
"Dec_9": [{
"count": 1,
"term": "2012"
}]
}]]
if you want a result like Dec 9, 1, 2012
, you need a method to parse an object to string (or string array), code like:
function valuesOfObj(obj, result) {
result = result || [];
if (typeof obj === 'object') {
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
arguments.callee(obj[k], result);
}
}
} else {
result.push(obj);
}
return result;
}
console.log(valuesOfObj([{
"term": "Dec 9",
"Dec_9": [{
"count": 1,
"term": "2012"
}]
}]).join(', ')); // -> Dec 9, 1, 2012
the full demo
By the way, what you done is excellent, there are some other achieve like jsonselect and JSONQuery, Hope useful for you.