比较好的直接导出服务器文件的JS
<SCRIPT type="text/javascript">
function downloadFile(url)
{
try{
var elemIF = document.createElement("iframe");
elemIF.src=url;
elemIF.style.display = "none";
document.body.appendChild(elemIF);
}catch(e){
}
}
</SCRIPT>
<span style="margin-bottom: 10px;cursor:pointer;" onclick="downloadFile('jsp/risk/model.xls');"> 导出模版</span>