本文介绍了以下json数据存在问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出以下json数据出了什么问题,我目前正在使用 http://jsonlint.com /验证它不断失败;

I'm trying to figure out whats wrong with the following json data, i'm currently using http://jsonlint.com/ to validate it which keeps failing with;

Parse error on line 9:
...                    "Question 2" : [   
-----------------------^
Expecting 'EOF', '}', ',', ']'

我的代码;

{ "questions" : {
                    "Question 1" : [
                    { "Q" :"Question" },
                    { "A" : "Answer A"  },
                    { "B" : "Answer B" },
                    { "C" : "Answer C" },
                    { "D" : "Answer D" },
                    { "Answer" : "C" }
                    ] 
                    "Question 2" : [
                    { "Q" :"Question" },
                    { "A" : "Answer A"  },
                    { "B" : "Answer B" },
                    { "C" : "Answer C" },
                    { "D" : "Answer D" },
                    { "Answer" : "C" }
                    ] 
}
                    }";

推荐答案

您忘记了逗号!

{ "questions" : {
                "Question 1" : [
                { "Q" :"Question" },
                { "A" : "Answer A"  },
                { "B" : "Answer B" },
                { "C" : "Answer C" },
                { "D" : "Answer D" },
                { "Answer" : "C" }
                ],
                "Question 2" : [
                { "Q" :"Question" },
                { "A" : "Answer A"  },
                { "B" : "Answer B" },
                { "C" : "Answer C" },
                { "D" : "Answer D" },
                { "Answer" : "C" }
                ] 
}}

这篇关于以下json数据存在问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 12:38