开发者

json parsererror

why this error

xhr: [object XMLHttpRequest] textStatus: parsererror errorThrown: Invalid JSON: [ { "id": "10000000", "label": "10000000" }, { "id": "10000001", "label": "10000001" }, {开发者_如何学编程 "id": "10000003", "label": "10000003" }, { "id": "10000005", "label": "10000005" }, { "id": "10000006", "label": "10000006" } ]


Copied and pasted this:

[ { "id": "10000000", "label": "10000000" }, { "id": "10000001", "label": "10000001" }, { "id": "10000003", "label": "10000003" }, { "id": "10000005", "label": "10000005" }, { "id": "10000006", "label": "10000006" }]

to JSONlint and it says it's valid.


Can you post the original JSON if that is the original then the it is missing a root key

var textStatus = {"keys":[{"id":"...", "label":"..."},{"id":"...","label":"..."}]}

Also the whole thing needs to be inside {} to make it an object what you had is just an array

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜