<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT LANGUAGE=javascript>
<!--
var sonPage=window.open("about:blank");function window_onunload() {
sonPage.close();
}//-->
</SCRIPT>
</HEAD>
<BODY LANGUAGE=javascript onunload="return window_onunload()">
</BODY>
</HTML>

解决方案 »

  1.   

    父窗口代码:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <link rel=stylesheet href="./css.css">
    <title>ModiaDialog</title>
    </head>
    <body>
    <INPUT TYPE="button" name="button1" value="ShowModaldialog" onclick="b1()">
    </form>
    </body>
    </html>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function b1()
    {
    aa=showModalDialog("modaldialog.asp",window,"dialogheight:200px");
    }
    //-->
    </SCRIPT>子窗口代码:(modialdialog.asp的代码)
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function b1()
    {
    number1=50;
    char1="Merry christmas!";
    document.form1.text1.value=number1;
    document.form1.text2.value=char1;
    } function WindowClose()
    {
    obj=window.dialogArguments;
    window.close();
    obj.close();
    }
    //-->
    </SCRIPT>
      

  2.   

    window.close();
    window.opener.close();