页面中有 onbeforeunload ,用于确认关闭网页时提示, 但当用户点击退出系统,出现提示,用户选择“取消”保留在原来的页面后,以前该页面的下载功能不太正常了, 每次点击,都会弹出退出系统的确认? 请问如何修改呢?因为csdn不支持附件,我将工程源码放到了邮箱:[email protected], 密码:csdn_csdn. 真诚希望能得到您的帮助!
以下为部分源码:<script type="text/javascript" language="javascript">
<!--
function confirmExitSystem(){
event.returnValue = "确实要退出系统吗?";
}
function downloadFile(fileFullPath){
downFileForm.fileFullPath.value = "/images/test.jpg";
downFileForm.target="hiddenSubmitIFrame";
downFileForm.submit();
}
//-->
</script>
</head>
<body onbeforeunload="confirmExitSystem();" >
<input type="button" name="button" value="下载文件测试" onclick="downloadFile()" >
<form name="downFileForm" action="<%=request.getContextPath()%>/downFile" method="post">
<input name="fileFullPath" type="hidden" value="" />
<iframe name="hiddenSubmitIFrame" id="hiddenSubmitIFrame" width="0" height="0" frameborder="0"></iframe>
</form>
</body>
</html>
以下为部分源码:<script type="text/javascript" language="javascript">
<!--
function confirmExitSystem(){
event.returnValue = "确实要退出系统吗?";
}
function downloadFile(fileFullPath){
downFileForm.fileFullPath.value = "/images/test.jpg";
downFileForm.target="hiddenSubmitIFrame";
downFileForm.submit();
}
//-->
</script>
</head>
<body onbeforeunload="confirmExitSystem();" >
<input type="button" name="button" value="下载文件测试" onclick="downloadFile()" >
<form name="downFileForm" action="<%=request.getContextPath()%>/downFile" method="post">
<input name="fileFullPath" type="hidden" value="" />
<iframe name="hiddenSubmitIFrame" id="hiddenSubmitIFrame" width="0" height="0" frameborder="0"></iframe>
</form>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货