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

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

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

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

posted on 2019-04-20 09:37  让我再想想  阅读(10414)  评论(0编辑  收藏  举报

导航