首页 > 微信 > 详细

【微信小程序】微信小程序页面url传参,使用JSON.parse报错Unexpected end of JSON input

时间:2021-05-04 23:37:46      阅读:38      评论:0      收藏:0      [点我收藏+]

微信小程序页面url传参,使用JSON.parse报错Unexpected end of JSON input

参考


一开始以为是url传参的长度限制原因。

其实是因为参数中有特殊字符导致数据截取,所以接收参数后,无法解析json格式。

用的解决方法是encodeURIComponent()和decodeURIComponent(),见参考文章。

【微信小程序】微信小程序页面url传参,使用JSON.parse报错Unexpected end of JSON input

原文:https://www.cnblogs.com/musecho/p/14730155.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!