JSON.parse() 与 json.stringfy()

JSON.parse() :是将一系列 JSON 格式的字符串转换为 JSON 格式的对象数组

json.stringfy():而这个则是与 JSON.parse() 相反

JSON.parse() 在使用过程中,发现字符若过多时,会 报这个错误

 Uncaught SyntaxError: Unexpected token  in JSON at position 6217

当向后台查询数据减少到一定量时,就能正常转换格式 。

报此错时,查询的数据其中包含许多中文字。

猜你喜欢

转载自www.cnblogs.com/JaneBlog/p/9116633.html