JSON.parse报错Uncaught SyntaxError: Unexpected token ' in JSON at position 1 at JSON.parse (<anonymous>) at <anonymous>:1:6

 

JS在使用JSON.parse时报错如下:

Uncaught SyntaxError: Unexpected token ' in JSON at position 1
at JSON.parse (<anonymous>)
at <anonymous>:1:6

只需要将大括号边上换成单引号即可

 

posted @ 2022-04-29 00:13  腹肌猿  阅读(673)  评论(0编辑  收藏  举报