报错Unexpected token u

报错Unexpected token u,出错位置提示在index.html的第一行。

出现这个错误的原因是尝试JOSN.parse一个undefined的对象导致的,解决办法就是如果为undefined就设置成null。null不会导致错误 。

猜你喜欢

转载自www.cnblogs.com/ranyonsue/p/9083566.html