URL中包含url参数,(文件路径作为参数)

时间:2019-04-20 11:56:31   收藏:0   阅读:564

用encodeURIComponent方法,把路径放在里面,可以防止斜杠被取消。

以下attachfiles是我的一个文件的绝对路径。

window.location.href="${pageContext.request.contextPath}/competionFlow/attachfile?attachfiles="+encodeURIComponent(attachfiles);

原文:https://www.cnblogs.com/ly-520/p/10739943.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!