firefox浏览器与IE浏览器不兼容问题~~急求大牛
jsp页面上不兼容部分的代码:
<div id='divfile' style="background-color: white;display: none;">
<table style="WIDTH: 90%;">
<tr>
<%
String excelPath = "";
if("6200".equals(sapno))
{
excelPath="salesforecastitaly/";
}else if("6280".equals(sapno))
{
excelPath="salesforecastgerman/";
}
else if("6300".equals(sapno))
{
excelPath="salesforecastusa/";
}
else
{
excelPath="salesforecast/";
}
%>
<td style="text-align: center">
<input type="button" icon='icon-excel' value=" <bean:message key='label.downloadtemplate' />" onclick="javascript:document.location='<%=request.getContextPath()%>/console/pages/common/download.jsp?filename=<bean:message key='label.templatename' />_<%=pcycle %>.xlsx&filedir=/console/pages/basedata/<%=excelPath %>'"></input>
<input type="button" value=" <bean:message key='label.commit' />" icon='icon-submit' onclick="importExcel();"></input>
</td>
</tr>
<tr>
<td style="text-align: center" >
<input type="text" id="fakefile" name="fakefile" size="60" readOnly> <input type="button" icon='icon-folder_open' onclick="choosefile();" value=" <bean:message key='label.choosefile' />">
</td>
</tr>
<tr>
<td id="statustd" style="text-align: center" >
</td>
</tr>
</table>
</div>
<iframe name="upfileframe" id="upfileframe" width="0" height="0" src="<%=request.getContextPath()%>/console/pages/basedata/salesforecast/uploadImport.jsp" onload ="iframeload = true;"></iframe>
其中是一个div包含了一个table,table里有下载模板(label.downloadtemplate),提交(label.commit)以及一个文件选择功能。
当前问题是在我载入该jsp文件时firefox会自动运行下载模板功能。以及提交功能。
下面是相应的一些列的js方法
/* 导入 */
function onImport()
{
alert("000");
if(!checkAddImportDel())
{
alert("Sales forecast can only be uploaded from Monday to Wednesday.");
return;
}
var startDate = document.getElementById("startDate").value;
if(startDate=="")
{
alert("Forecast Date is mandatory.");
return;
}
$('#divfile').modal({"autoResize":true,
"onClose":function(){
if(document.frames("upfileframe").document.all.retcode.value == 'S'){
alert("123");
document.EAPForm.pageNo.value="1";
document.EAPForm.action=unieap.WEB_APP_NAME+"/salesForecast.do?method=getList";
document.EAPForm.submit();
}else{
alert("456");
this.close();
document.EAPForm.pageNo.value="1";
document.EAPForm.action=unieap.WEB_APP_NAME+"/salesForecast.do?method=getList";
document.EAPForm.submit();
}
}
});
}
/* 导入提交 */
function importExcel()
{
alert("submit")
var file = $("#fakefile").val();
if(file == "")
{
retmsg("Pls choose the file");
return;
}
var suffix = file.substring(file.lastIndexOf('.')+1,file.length);
if(suffix != 'xls' && suffix != 'XLS' && suffix!='xlsx')
{
retmsg("Pls choose xls file or xlsx file");
return;
}
$("#statustd").html("<img src='"+unieap.WEB_APP_NAME+"/console/images/ico/loading_ani.gif'></img>");
document.frames("upfileframe").OnSubmit();
}
/*选择文件*/
function choosefile()
{
if(!iframeload) return;
document.frames("upfileframe").document.EAPForm.importfile.click();
}
/* 错误反馈 */
function retmsg(msg)
{
if(!msg)
msg = document.frames("upfileframe").document.all.retmsg.value;
$("#statustd").html("<font color=red><b>" + msg + "</b></font>");
}
请各位大牛帮帮忙~~~~~