在 window.showModalDialog生成的模式对话框(模式窗口) 下载文件 ,页面跳转不能用。
解决之道:对话框引入的页面引入iframe
下载文件例子:
<!--js 方法-->
function exportExcel(){
document.getElementById("downFile").src="<%=path %>/statAnal/oftenExcelReport/excel.action?wbName=zx_ds_zdy_wb";
}
<!--引入iframe-->
<body style="overflow:scroll">
<iframe id="downFile" width=0 height=0 frameborder=0 scrolling=auto src="" ></iframe>
<form id="form0" name="form0" method="post" action="">
...
</form>
<!-- 点击按钮调用js方法-->
<input name="button" type="button" class="button1" οnclick="javascript:exportExcel()" value="导出报表"/>
<body>