我使用setTimeout 2秒后运行TUr()函数打开一个页面,在本地测试很正常,上传到服务器,就无法弹出了。
<script language="JavaScript">
function DownLoad(){
document.all.apDiv1.style.display='';
setTimeout('TUrl()',2000); //指定2秒运行
}
function TUrl()
{
window.open('/SysPrint/Manage/Otherwise/AuditingBackup_Excel.asp?tmp='+Math.random(),'Excel');
document.all.apDiv1.style.display='none';
}
</script>
<script language="JavaScript">
function DownLoad(){
document.all.apDiv1.style.display='';
setTimeout('TUrl()',2000); //指定2秒运行
}
function TUrl()
{
window.open('/SysPrint/Manage/Otherwise/AuditingBackup_Excel.asp?tmp='+Math.random(),'Excel');
document.all.apDiv1.style.display='none';
}
</script>
解决方案 »
- 新手求教。在form表单里面不能使用appendChild()
- 如何使用javascript动态加载内容
- 请教:当输入框换行的问题。
- EXTJS4怎样PANEL引用其他页面的PANEL
- 请问怎么读取一个IFrame内部标签的值?
- 问个checkbox的问题
- 这段简单代码在ie中没有问题,在netscape中不能执行,高手给看看
- 急!!!用代码怎样来自动对浏览到的图片自动按比例进行缩放??
- 高分求教大虾!ie中打印如何实现分页打印?
- 圣诞提问,解决有赏
- 不显示删除回复显示所有回复显示星级回复显示得分回复 下拉选择时, 怎样让所在的层不消失,下拉框也不消失
- 如何移除或者禁止页面中的JAVASCRIPT
1.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
</head>
<script language="JavaScript">
function DownLoad(){
setTimeout('TUrl()',1000); //指定1秒运行
//window.open(2.asp?tmp='+Math.random(),'Excel');
}
function TUrl()
{
window.open(2.asp?tmp='+Math.random(),'Excel');
}
</script>
<body>
<span class="indiv"><img src="../Images/excel.gif" width="70" height="21" align="absmiddle" style="cursor:pointer" onclick="DownLoad()" /><iframe name="Excel" style="display:none"></iframe></span>
</body>
</html>2.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'查询数据'生成Excel
Response.AddHeader "content-type","application/x-msdownload"
Response.AddHeader "Content-Disposition","attachment;filename=1.xls"
Response.charset="GB2312"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Excel</title>
</head><body>
dfgdsgdfg
</body>
</html>
必须将js改成<script language="JavaScript">
function DownLoad(){
setTimeout('TUrl()',1000); //指定1秒运行
window.open(2.asp?tmp='+Math.random(),'Excel');
}
function TUrl()
{ }
</script>