Unexpected end of JSON input

发布于 8 年前作者 guiyingwei20279 次浏览最后编辑 8 年前来自 ask

WAService.js:3 thirdScriptError

Unexpected end of JSON input;at “pages/StepByStepToSurplus/AnswerResult/AnswerResult_Error” page lifeCycleMethod onLoad function

SyntaxError: Unexpected end of JSON input

    at e.onLoad 

3 回复
ping16
ping161 楼6 年前

我也遇见了这样的问题,求解

yyu
yyu2 楼6 年前

解决方案:一般获取的json数据先转换成string字符,如:JSON.stringify(json),然后用encodeURIComponent 编码,如encodeURIComponent(string), 就可以传参过去了,到接收页 ,先 decodeURIComponent(data),然后在 JSON.parse() 取得json数据 赋值!

fangshen
fangshen3 楼6 年前

怎么解决 大佬