关闭窗口是不提示代码

方法之一:
 function NavigateToIndex()
    
{
        window.open(
"Index.aspx","_blank","fullscreen=yes, menubar=no, resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no");
        window.opener 
= "X";
        window.open('','_parent','');
        window.close();
    }

方法二:
    
function closeWindows()
    
{
         document.all.WebBrowser.ExecWB(
45,1);
         openNewWindow('Index.aspx');
    }
        <object id="WebBrowser" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
        </object>

完整代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>

    <script language="javascript" type="text/javascript">
    function openNewWindow(url)
    {
        window.open(url,'window1','height=768,width=1000,status=yes,toolbar=no,menubar=no,location=no,top=0,left=0,resizable=yes','');
    }
   
    function NavigateToIndex()
    {
        window.open("Index.aspx","_blank","fullscreen=yes, menubar=no, resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no");
        window.opener = "X";
        window.open('','_parent','');
        window.close();
    }
    function closeWindows()
    {
         document.all.WebBrowser.ExecWB(45,1);
         openNewWindow('Index.aspx');
    }
   
   
   
    </script>

</head>
<body onload="closeWindows();">
    <form id="form1" runat="server">
        <object id="WebBrowser" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
        </object>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <table border="0" cellpadding="0" cellspacing="0" style=" 100%; height: 900px;
            background-color: Aqua;">
            <tr>
                <td onclick="openNewWindow('Index.aspx');">
                    ddddddddddddd
                </td>
            </tr>
        </table>
    </form>
</body>
</html>

原文地址:https://www.cnblogs.com/wubiyu/p/839787.html