IE浏览器window.location.href导出无效问题解决

window.location.href = "/exportExcel?flag="+flag+"&val="+val+"&title="+title+"&notin="+notin;

该代码在谷歌浏览器能正常访问后台导出方法,而在IE浏览器下却报错了,原因是title的值中有中文参数乱码了

解决办法:

window.location.href = "/exportExcel?flag="+flag+"&val="+val+"&title="+encodeURI(encodeURI(title))+"&notin="+notin;

后台转换:

String title = java.net.URLDecoder.decode(title, "utf-8");

猜你喜欢

转载自www.cnblogs.com/loveBetty/p/12448512.html
今日推荐