嗨,我有这段代码来解析JQUERY上的JSON

var json_text2 = $.parseJSON('{"data":[["1340650436","2.00000"],["1340736844","4.00000"]],"label":"Waist Size (cm)"},{"data":[["1340736861","3.40000"],["1340650514","4.00000"]],"label":"Arm Size (Inch)","yaxis":"2"}');

但是我在Firebug上遇到了这个错误
JSON.parse: unexpected non-whitespace character after JSON data

最佳答案

有效的JSON字符串必须是单个对象或对象数组。将对象包装在数组括号[]中:

var json_text2 = $.parseJSON('[{"data":[["1340650436","2.00000"],["1340736844","4.00000"]],"label":"Waist Size (cm)"},{"data":[["1340736861","3.40000"],["1340650514","4.00000"]],"label":"Arm Size (Inch)","yaxis":"2"}]');

10-08 03:33