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

千行

关注

阅读 62

2022-08-23


解决办法:对要传递的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)

0 0 举报