【发布时间】:2019-03-21 08:12:39
【问题描述】:
这个 JSON 字符串似乎是无效的,但是当我用 JSONLint 检查它时它说它是有效的,所以问题出在哪里。在位置 252 处弹出错误。
let test = JSON.parse('[{"id":6,"item_type":"cybro_unit","unitId":6,"pos_id":9,"name":"CyBro-2","image":"images/cybro/defaultBro.png","layer":"10","positionX":111.0,"positionY":249.0,"layerName":"10","sizeX":201.0,"sizeY":168.0,"z_index":9999,"showLabel":true,"hint":"CyBro-2\nPovezan: true\nVelikost X: 201.523163\nVelikost Y: 168.675491","enabled":true,"connected":false}]');
[{
"id": 6,
"item_type": "cybro_unit",
"unitId": 6,
"pos_id": 9,
"name": "CyBro-2",
"image": "images/cybro/defaultBro.png",
"layer": "10",
"positionX": 111.0,
"positionY": 249.0,
"layerName": "10",
"sizeX": 201.0,
"sizeY": 168.0,
"z_index": 9999,
"showLabel": true,
"hint": "CyBro-2\nPovezan: true\nVelikost X: 201.523163\nVelikost Y: 168.675491", // here at CyBro-2
"enabled": true,
"connected": false
}]
【问题讨论】:
-
我只是添加了评论让用户知道错误发生在哪里
标签: javascript arrays json object