(SyntaxError): missing ] after element list when using eval

被刻印的时光 ゝ 提交于 2020-01-02 09:19:06

问题


I get following error (SyntaxError): missing ] after element list when using eval function. Returned JSON is pretty simple, so I don't undestand where is error.

[{"title":"sfsdf","id":1}{"title":"m356","id":12}]

回答1:


As an answer for completeness. Your JSON is invalid. You need a comma between the Objects like so:

[{"title":"sfsdf","id":1},{"title":"m356","id":12}]



回答2:


First you have lost the comma between the Object,the Second Jquery will parse the Object automaticly. i suggest you don't use this method. i also meet thie question,but there're some difference from yours.



来源:https://stackoverflow.com/questions/11215185/syntaxerror-missing-after-element-list-when-using-eval

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!