首页 > json格式问题

json格式问题

[

{
    "id": 1de9e48b7e7346f882268ee05ba2fe2e,
    "text": "32"
},
{
    "id": 2,
    "text": "text2"
},
{
    "id": 3,
    "text": "text3",
    "selected": true
},
{
    "id": 4,
    "text": "text4"
},
{
    "id": 5,
    "text": "text5"
}

]

报错
Parse error on line 3:
... { "id": 1de9e48b7e7346f88226
----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['

"id": 1de9e48b7e7346f88226这个有什么问题吗?


Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE'

json值只能为,字符串、数字、null、true、false


报错对的 你不是string类型

'1de9e48b7e7346f88226'就对了


字符串需要加双引号

【热门文章】
【热门文章】