0
点赞
收藏
分享

微信扫一扫

layer.open传递json报错java.lang.IllegalArgumentException: Invalid character found in the request target

千行 2022-08-23 阅读 62


解决办法:对要传递的json数据使用encodeURIComponent对 URI 进行编码

使用方法如下:

var jsonData = JSON.stringify(res);
jsonData = encodeURIComponent(jsonData);

layer.open({
type: 2
,title: '执行结果'
,area: ['750px', '450px']
,shade: 0
,maxmin: true
,content: 'show?res='+jsonData

});

 

举报

相关推荐

0 条评论