showModalDialog如何在执行完一段代码后自动关闭? 用vb.net或者c#.net的方式都可以。。 showModalDialog的关闭是个问题如何在执行完一个动作后关闭它。 提示:点击按钮触发调用showModalDialog,等按钮的,可以等Thread.Sleep(5000)这个做等待 .. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的程序是web应用还是桌面应用呀?另外你是希望在父窗口中关闭还是子窗口子子闭呀? 是web程序。希望子窗口“showModalDialog的关闭”让弹出的关闭 <head runat="server"><base target="_self"/> <title>添加基本的发货信息</title> <link href="../css/main.css" rel="stylesheet" type="text/css" />在跳出的页面HEAD里面加<base target="_self"/> 你看看 行不行 不行联系我啊 "在跳出的页面HEAD里面加 <base target="_self"/> "如何关闭??? 你要的是不是这样的效果?parentWnd.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <body> <h1>父窗口</h1> <input type="button" value="open" onclick="window.showModalDialog('childWnd.html');"> </body></html>childWnd.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <script language="javascript"> var t = 10; window.onload=function(){ count(); } function count(){ if (t <= 0) { window.close(); return; } div1.innerHTML = t + "秒"; --t; window.setTimeout("count()",1000); } </script> <body> <h1>子窗口</h1> <div id="div1"></div> </body></html> 用setInterval要简单些.childWnd.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <script language="javascript"> var t = 10; window.onload=function(){ setInterval("count1()",1000); } function count1(){ div1.innerHTML = t + "秒"; --t; if(t<=0){ window.close(); } } </script> <body> <h1>子窗口</h1> <div id="div1"></div> </body></html> 谢谢楼上朋友。。这个是用定时关闭的方法。。关键是我也不知道删除具体需要的时间。。最好是后台删除后就能直接调用前台js关闭showModalDialog! 如果你的处理是在了窗口调用的话,如果是使用ajax,则在处理完成后调用window.close()就可以了。如果是通过表单提交的话,则在返回的窗口中直接写入。<script language="javascript">window.close();</script> 求助:一个字符转义的问题! 如何取table中td的id号为何td赋值? jquery UI dialog打开一个新窗口问题????? 关于window.open()的,高手再进来看看,谢谢了 ie里面隐藏/显示某个单元格后,父表的大小能自动改变大小,但是在ff里面父表只会越来越大 node.js下面代码的含义 不知有人是否遇见过这样的问题! loadPicture问题,很值得研究,高手过来 json传值问题 萌新发现新世界 移動圖片問題 关于div的问题
另外你是希望在父窗口中关闭还是子窗口子子闭呀?
<base target="_self"/>
<title>添加基本的发货信息</title>
<link href="../css/main.css" rel="stylesheet" type="text/css" />在跳出的页面HEAD里面加<base target="_self"/> 你看看 行不行 不行联系我啊
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<h1>父窗口</h1>
<input type="button" value="open" onclick="window.showModalDialog('childWnd.html');">
</body>
</html>
childWnd.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<script language="javascript">
var t = 10;
window.onload=function(){
count();
}
function count(){
if (t <= 0) {
window.close();
return;
}
div1.innerHTML = t + "秒";
--t;
window.setTimeout("count()",1000);
}
</script>
<body>
<h1>子窗口</h1>
<div id="div1"></div>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<script language="javascript">
var t = 10;
window.onload=function(){
setInterval("count1()",1000);
} function count1(){
div1.innerHTML = t + "秒";
--t;
if(t<=0){
window.close();
}
}
</script>
<body>
<h1>子窗口</h1>
<div id="div1"></div>
</body>
</html>
如果是使用ajax,则在处理完成后调用window.close()就可以了。如果是通过表单提交的话,
则在返回的窗口中直接写入。<script language="javascript">
window.close();
</script>