共有3个asp文件,dia1.asp是起始母窗体,dia2.asp是第一层窗体,dia3.asp是第二层窗体。
因为每一层都要有值返回给opener,直到最后把值返给母窗体。所以,采用showModalDialog是最好的。
但是,用户希望,在第一层窗体调第二层窗体的时候,第一层窗体关掉或不显示(总之,不希望被看见)
(因为要把第二层窗体的值一层层地返给母窗体,所以个人认为第一层窗体不能关掉,只能移走或不显示出来)
如何移走啊?moveTo(),moveBy()都试过了,不好使。能让它不显示也成啊,不知道怎么实现。
各位高人有何其他良策阿?(必须使用showModalDialog,用woindow.open倒是可以,但没法返回值啊)
dia.asp如下:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-sjis">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<TITLE></TITLE>
<SCRIPT TYPE="text/JavaScript">
function fnOnLoad()
{
var winHeigth= 740;
var winWidth = 1024;
var ret=showModalDialog("dia2.asp", null, "dialogheight:" + winHeigth + "px; dialogwidth:" + winWidth + "px; dialogtop:0px; dialogleft:0px; resizable:no; status:no; scroll:no; help:no; dialoghide=no;");
window.opener="dummy";
window.close();
return;
}
</script>
</HEAD>
<BODY BGCOLOR="#529488" onLoad="fnOnLoad();" onContextmenu="return (false);">
</BODY>
</HTML>
dia2.asp如下:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-sjis">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<TITLE></TITLE>
<SCRIPT TYPE="text/JavaScript">
function fnKakutei()
{
var winHeigth= 500;
var winWidth = 700;
var ret=showModalDialog("dia3.asp", null, "dialogheight:" + winHeigth + "px; dialogwidth:" + winWidth + "px; dialogtop:0px; dialogleft:0px; resizable:no; status:no; scroll:no; help:no; dialoghide=no;");
window.opener="dummy";
window.close();
return;
}
</script>
</HEAD>
<base target="_self">
<BODY BGCOLOR="#529488">
<FORM method="post" name="form1" onSubmit="return (false);" >
<INPUT TYPE="button" NAME="btnCommit" VALUE="確定" onClick="fnKakutei();">
</FORM>
</BODY>
</HTML>
dia3.asp如下:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-sjis">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<TITLE></TITLE>
<SCRIPT TYPE="text/JavaScript">
function fnonload()
{
window.opener.close(); //在这儿好像根本取不到window.opener对象,不知为什么?又何方法可以取到?
return;
}
</script>
</HEAD>
<base target="_self">
<BODY BGCOLOR="#529488" onLoad="fnonload();" >
</BODY>
</HTML>
[求助][★急★]一个关于对话框的问题,谢谢