2017-04-13 147 views
-1

我是JSON的初学者。在www.jsoneditoronline.org上试图测试这个JSON时,我收到了错误的字符串错误。JSON中的字符串错误错误

{ 
astrMethodName: 
"BL2X2/g7NkZk0PR5YODRDSmsGpk 
vXf9xEXiGHYwk2co=", 
astrParameters: "", 
astrDataValueField: 
"1zzftXOCj6fFUf9IYSCzhw==", 
astrDataTextFiel 

能否请你帮

+0

我把它在'astrMethodName'中间的断行是如何它出现在编辑器中? JavaScript字符串文字不能跨越行。 –

+0

看起来像下面{ astrMethodName: “BL2X2/g7NkZk0PR5YODRDSmsGpkvXf9xEXiGHYwk2co =”, astrParameters: “sdfvdf”, astrDataValueField: “1zzftXOCj6fFUf9IYSCzhw ==”, astrDataTextFiel: “gsdgfg” } – Aaron88

回答

1

它的格式应该是这样:(注意我加引号)

{ 
    "astrMethodName": "BL2X2/g7NkZk0PR5YODRDSmsGpkvXf9xEXiGHYwk2co=", 
    "astrParameters": "sdfvdf", 
    "astrDataValueField": "1zzftXOCj6fFUf9IYSCzhw==", 
    "astrDataTextFiel": "gsdgfg" 
} 
0

JSON是无效的,因为它的格式不正确。

原因无效JSON

enter image description here

有效JSON应该是这样的

enter image description here