怎样才能使alert("已操作成功");弹出的窗口经过1秒后自动关闭?? 作为新页面打开,然后设置setTime控制关闭 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用showModalDialog + setTimeout(),那个图片显示不出来,你把alert()的那个叹号抓下来就行了test.htm========================================<html><head><title> New Document </title><script language="javascript">/*************************************************功能:可以自己定制的comfirm提示框,在IE6下测试通过**************************************************//**参数说明: strTitle confirm框的标题 strMessage confirm框要显示的消息 intWidth confirm框的宽度 intHeight confirm框的高度*/function myConfirm(strTitle,strMessage,intType,intWidth,intHeight){ var strDialogFeatures = "status=no;center=yes;help=no;dialogWidth="+intWidth+";dialogHeight="+intHeight+";scroll=yes;resize=no"; var args = new Array(); args[args.length] = strTitle; args[args.length] = strMessage; args[args.length] = intType; var result = showModalDialog("myConfirm.htm",args,strDialogFeatures); return result;}function test(){ var myConfirmResult = myConfirm("这里是标题","aaa",2,12,7)}</script></head><body><input type="button" value="点我试试" onclick="test()"><br><br></html>myConfirm.htm========================<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script language="javascript"><!--var args = window.dialogArgumentstry{ document.title = args[0]; //设置标题}catch(e){//这里屏蔽了错误,防止万一调用的传递参数不足}//--></script><title></title><style type="text/css"><!--body { margin-left: 0px; margin-top: 0px; background-color: menu; overflow: hidden; overflow-x:hidden; overflow-y:hidden;}--></style><script language="javascript">function init(){ setTimeout("window.close()",1000) var args = window.dialogArguments try{ message.innerHTML = args[1]; //设置提示的信息 }catch(e) { //这里屏蔽了错误,防止万一调用的传递参数不足 } ok.attachEvent("onclick",okClick); //设置YES按钮的事件处理函数}function okClick()//YES按钮的事件处理函数{ window.close();}window.attachEvent("onload",init)</script></head><body><table width="100%" border="0" cellspacing="5"> <tr> <td><div align="center"> <img src="images/ico.gif" width="33" height="32"> </div></td> <td><div align="left" id="message"></div></td> </tr> <tr> <td colspan="2"> <div align="center"> <input name="ok" type="button" id="ok" value=" 确定 "> </div></td> </tr></table></body></html> alert("")不能自动关闭吧.你可以自己用层模拟.然后,在setInerval来控制其可见性. 同意 wanghr100(灰豆宝宝.net) 我觉得可以这样,在alert("");后用javascript模拟按下回车健new ActiveXObject('Wscript.Shell')).SendKeys('{回车}')可以结合setTimeout 那你自己模拟一个小的探出窗体好了,做个小的页面----------------aaaaaa.html------------------------------------这是一个弹出窗体自动关闭的程序<script language="javascript"> aa = window.open("","_black", "width=200,height=100,top=200,left=300"); aa.document.write("<body bgcolor='gray'><h4>hello world!</h4><center><input type='button' value=' 确 认 ' onclick='window.close()'></center></body>"); setTimeout("aa.close()", 2000);</script> alert窗口在网页中是无法自动关闭的,wscript宿主脚本只能用在本机,可以采用大家所说的方法,模式窗比较适合 弹出alert框,一秒后自动关闭<br/><script language="JavaScript">var aaafunction test(){aaa=if0.showModelessDialog("javascript:alert();window.close();","","status:no;resizable:no;help:no;dialogHeight:30px;dialogWidth:40px;");setTimeout("if0.location.reload();",1000);}</script><iframe style="display:none" name=if0 ></iframe><input type="button" value="弹出alert框,一秒后自动关闭;" onClick="JavaScript:test()"></form>参考JK_10000(JK) <html><body><script language="JavaScript">function test(){showModelessDialog("javascript:alert();window.close();","","status:no;resizable:no;help:no;dialogHeight:30px;dialogWidth:40px;");setTimeout("location.reload();",1000);}</script></body><input type="button" value="弹出alert框,一秒后自动关闭;" onClick="JavaScript:test()"></html> 鼠标拖动DIV层的移动范围 关于Firefox不支持JS的selectSingleNode()和selectNodes(),高手们帮帮忙阿!!!谢谢拉!!! 弹窗实用代码 下面这段JS看不懂,谁能帮忙看下 怎么实现WEB表格 在网页上怎么才能让ppt只能打开不能下载? 怎么样右击table任一行出一菜单? extjs pagingtoolbar参数封装问题 如何传按钮的名称 请问高手怎样才能实现判定客户端IE和netscape语言的版本,来打开不同的网页呢?谢谢! 如何隐藏iframe中的代码? 一个简单问题(wait)——问题比较弱,希望能得到详细的解答,谢谢
========================================
<html>
<head>
<title> New Document </title>
<script language="javascript">
/*************************************************
功能:可以自己定制的comfirm提示框,在IE6下测试通过
**************************************************//**
参数说明: strTitle confirm框的标题
strMessage confirm框要显示的消息
intWidth confirm框的宽度
intHeight confirm框的高度*/
function myConfirm(strTitle,strMessage,intType,intWidth,intHeight)
{
var strDialogFeatures = "status=no;center=yes;help=no;dialogWidth="+intWidth+";dialogHeight="+intHeight+";scroll=yes;resize=no";
var args = new Array();
args[args.length] = strTitle;
args[args.length] = strMessage;
args[args.length] = intType;
var result = showModalDialog("myConfirm.htm",args,strDialogFeatures);
return result;
}
function test()
{
var myConfirmResult = myConfirm("这里是标题","aaa",2,12,7)}
</script>
</head><body>
<input type="button" value="点我试试" onclick="test()">
<br>
<br>
</html>
myConfirm.htm
========================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
<!--
var args = window.dialogArguments
try{
document.title = args[0]; //设置标题
}catch(e)
{
//这里屏蔽了错误,防止万一调用的传递参数不足
}//-->
</script>
<title></title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
background-color: menu;
overflow: hidden;
overflow-x:hidden;
overflow-y:hidden;
}
-->
</style>
<script language="javascript">
function init()
{
setTimeout("window.close()",1000)
var args = window.dialogArguments
try{
message.innerHTML = args[1]; //设置提示的信息
}catch(e)
{
//这里屏蔽了错误,防止万一调用的传递参数不足
}
ok.attachEvent("onclick",okClick); //设置YES按钮的事件处理函数
}
function okClick()//YES按钮的事件处理函数
{
window.close();
}
window.attachEvent("onload",init)
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="5">
<tr>
<td><div align="center">
<img src="images/ico.gif" width="33" height="32"> </div></td>
<td><div align="left" id="message"></div></td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input name="ok" type="button" id="ok" value=" 确定 ">
</div></td>
</tr>
</table>
</body>
</html>
你可以自己用层模拟.
然后,在setInerval来控制其可见性.
new ActiveXObject('Wscript.Shell')).SendKeys('{回车}')可以结合setTimeout
----------------aaaaaa.html------------------------------------
这是一个弹出窗体自动关闭的程序
<script language="javascript">
aa = window.open("","_black", "width=200,height=100,top=200,left=300");
aa.document.write("<body bgcolor='gray'><h4>hello world!</h4><center><input type='button' value=' 确 认 ' onclick='window.close()'></center></body>");
setTimeout("aa.close()", 2000);
</script>
宿主脚本只能用在本机,可以采用大家所说的方法,模式窗比较适合
var aaa
function test()
{
aaa=if0.showModelessDialog("javascript:alert();window.close();","","status:no;resizable:no;help:no;dialogHeight:30px;dialogWidth:40px;");
setTimeout("if0.location.reload();",1000);}
</script>
<iframe style="display:none" name=if0 ></iframe>
<input type="button" value="弹出alert框,一秒后自动关闭;" onClick="JavaScript:test()">
</form>参考JK_10000(JK)
<body>
<script language="JavaScript">
function test()
{
showModelessDialog("javascript:alert();window.close();","","status:no;resizable:no;help:no;dialogHeight:30px;dialogWidth:40px;");
setTimeout("location.reload();",1000);}
</script>
</body>
<input type="button" value="弹出alert框,一秒后自动关闭;" onClick="JavaScript:test()">
</html>