怎么没人帮我呢?
我模拟了一下,
这个是打开对话框的页面:
<HTML>
<HEAD>
<META http-equiv="content-type" content="text/html; charset=EUC-JP">
<TITLE>PopWindow</TITLE>
</HEAD>
<SCRIPT>
url="./passwd.html";
window.showModalDialog(url,self, "dialogHeight:165px;dialogWidth:350px;scrollbars:0;status:0;help:0;edge:sunken;");
</SCRIPT>
<BODY>
</BODY>
</HTML>这个就是对话框页面:
<HTML>
<HEAD>
<META http-equiv="content-type" content="text/html; charset=EUC-JP">
<TITLE>Conversation</TITLE>
</HEAD>
<script>
function noClose() {
var Location=window.location.href;
// var truthBeTold = window.confirm("Can't close");
//if(!truthBeTold){
//window.showModalDialog(Location,self, "dialogHeight:165px;dialogWidth:350px;scrollbars:0;status:0;help:0;edge:sunken");
//window.close;
// }
}
</script>
<body onBeforeUnload="noClose()">
<CENTER>
<FORM name="PasswordForm">
<TABLE BORDER="0" width="340">
<TR valign="top">
<TD align="center" valigh="center">
<INPUT type="button" name="execute" value="实行" CLASS="button" onclick="check()">
</TR>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>我考虑了用onBeforeUnload事件,想在对话框关闭后再弹出一个同样的,但是结果是前一个都没关掉!
或者可以捕捉window.close事件?甚至覆盖它?
大虾们快救命啊!
我模拟了一下,
这个是打开对话框的页面:
<HTML>
<HEAD>
<META http-equiv="content-type" content="text/html; charset=EUC-JP">
<TITLE>PopWindow</TITLE>
</HEAD>
<SCRIPT>
url="./passwd.html";
window.showModalDialog(url,self, "dialogHeight:165px;dialogWidth:350px;scrollbars:0;status:0;help:0;edge:sunken;");
</SCRIPT>
<BODY>
</BODY>
</HTML>这个就是对话框页面:
<HTML>
<HEAD>
<META http-equiv="content-type" content="text/html; charset=EUC-JP">
<TITLE>Conversation</TITLE>
</HEAD>
<script>
function noClose() {
var Location=window.location.href;
// var truthBeTold = window.confirm("Can't close");
//if(!truthBeTold){
//window.showModalDialog(Location,self, "dialogHeight:165px;dialogWidth:350px;scrollbars:0;status:0;help:0;edge:sunken");
//window.close;
// }
}
</script>
<body onBeforeUnload="noClose()">
<CENTER>
<FORM name="PasswordForm">
<TABLE BORDER="0" width="340">
<TR valign="top">
<TD align="center" valigh="center">
<INPUT type="button" name="execute" value="实行" CLASS="button" onclick="check()">
</TR>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>我考虑了用onBeforeUnload事件,想在对话框关闭后再弹出一个同样的,但是结果是前一个都没关掉!
或者可以捕捉window.close事件?甚至覆盖它?
大虾们快救命啊!
===================
<script>
var a = window.showModalDialog("test5.htm")
for(i=0;i<a.length;i++) alert(a[i])
</script> test5.htm
===================
<script>
function sendTo()
{
var a=new Array("a","b")
window.returnValue = a
window.close()
}
</script>
<body>
<form>
<input value="返回" type=button onclick="sendTo()">
</form>