• 自动关闭IE6或IE7窗口时不出现提示


    在IE7中使用window.close();自动关闭窗口时会出现确认关闭的提示.

    以下代码可以防止出现这样的提示:
    JavaScript代码
    <script language="javascript">   
     
        openLogin();   
           
        function randomNumber(limit){   
          return Math.floor(Math.random()*limit);   
        }   
           
        function openLogin() {   
           
            var loginWidth=718;   
            var loginHeight=540;   
            x=(screen.width-loginWidth)/2;   
            y=(screen.height-loginHeight)/2;   
           
            window.resizeTo(loginWidth,loginHeight+20);   
            window.moveTo(x,y);   
               
            var myWin = window.open("http://www.google.com","contactWeb"+randomNumber(10000),"toolbar=0,location=0,status=0,menubar=0,scrollbars=auto,resizable=no,width="+loginWidth+",height="+loginHeight+",left="+x+",top="+y);   
            window.opener = null;    // 关闭IE6、IE7窗口不再提示   
            window.open('','_top'); // 关闭IE7窗口不再提示   
            window.close();   
        }   
           
    </script>   

    以下是在IE6中有效的代码:
    JavaScript代码
    function DestroySelf()   
    {   
        var oMe = window.self;   
        oMe.opener = window.self;   
        oMe.close();   
    }   
     
    function LoginSucc(pc)   
    {      
        window.open("/portal/Portal.aspx?PassCode="+pc+"","BE_MAIN", "height=" + (window.screen.availHeight - 60) + ", width=" + (window.screen.availWidth - 14) + ", top=0, left=0, menubar=0, location=0, resizable=1, status=1");   
        setTimeout("DestroySelf()",100);   
  • 相关阅读:
    .Net程序破解
    SyntaxHighlighter插件测试
    Executing SQL using an ArcSDE connection
    VisualSVN增加密码php修改页面
    SyntaxHighlighter插件测试
    Executing SQL using an ArcSDE connection
    VisualSVN增加密码php修改页面
    FreeTextBox增加表情和代码着色功能
    找到了一篇用户角色处理的好文章
    男人25岁前的忠告
  • 原文地址:https://www.cnblogs.com/ice5/p/1374319.html
Copyright © 2020-2023  润新知