posts - 495,comments - 227,trackbacks - 0

          當(dāng)我們用這種方法:Response.Write("<script>window.close()</script>")
          總是提示什么:你查看的網(wǎng)頁試圖關(guān)閉的提示
          如何去掉提示,直接關(guān)閉窗體?
          可以用以下方法:
          Response.Write("<script>window.opener=null;window.close()</script>")
          只有ie6才支持.
          opener只要設(shè)為任何值都可以,不會(huì)出現(xiàn)提示

          如果是通過子窗體關(guān)閉父窗體時(shí)怎么做呢
          子窗體(彈出窗體):
          同理可得:
          Response.Write("<script>window.opener.top.opener=null;window.opener.top.close()</script>")

          posted on 2007-03-23 10:30 SIMONE 閱讀(43581) 評(píng)論(18)  編輯  收藏 所屬分類: JavaScript

          FeedBack:
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2008-05-23 18:34 | twinkle
          window.opener=null
          window.open("","_self")
          window.close();
          qq:1115113  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2008-05-23 18:34 | twinkle
          上面的ie678通用  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉[未登錄]
          2008-05-24 10:36 | simone
          嗯 ,記下。謝謝~~  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2008-06-05 08:50 | joyous
          什么 東西咯
          window.opener=null
          window.open("","_self")
          window.close();

          請寫清楚好不!  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2008-07-29 09:31 | haiyun
          挺有效的
          試了很多只有這個(gè)代碼在IE7上才能實(shí)現(xiàn)
          @twinkle
            回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2008-08-18 10:39 | jeems
          @twinkle的方法其實(shí)就是:
          Response.Write("<script>window.opener=null;window.open(‘’,‘_self’) ;window.close()</script>")

          和不用window.opener=null;也行


          Response.Write("<script>window.open(‘’,‘_self’) ;window.close()</script>")
            回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉[未登錄]
          2010-09-11 11:47 | 123
          @twinkle

          你試驗(yàn)過嗎,怎么我就不成功呢,直接復(fù)制的都不行!  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉[未登錄]
          2011-02-25 14:09 | google
          我的也是沒有成功,用上面的方法。  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2011-04-03 14:42 | 梅州遠(yuǎn)成科技
          我試了,可以的,ie8。上面說不可以的應(yīng)該是引號(hào)沒改過來,要小寫的。
            回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2011-09-20 19:41 | tanzhipeng
          得到幫助了,很感謝!  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2012-05-07 09:12 | 博魔園
          Response.Write("<script>window.opener=null;window.open(‘’,‘_self’) ;window.close()</script>")
          這個(gè)可以,我試了別的都不行。。  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2012-09-17 21:12 | 李民
          我用onclick="window.close();" 怎么點(diǎn)擊后沒反應(yīng)的  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉[未登錄]
          2013-04-02 12:02 | df
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉[未登錄]
          2013-04-02 13:25 | df
          @twinkle
            回復(fù)  更多評(píng)論
            
          # 333[未登錄]
          2013-04-02 13:26 | df
          dfsdfsdfs  回復(fù)  更多評(píng)論
            
          # 44444444[未登錄]
          2013-04-02 13:26 | df
          ffrwrqrewrq  回復(fù)  更多評(píng)論
            
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2013-06-05 23:35 | asd
          # re: window.close關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉
          2013-08-23 13:11 | sdfsdf
          window.opener=null
          window.open("","_self")
          window.close();

          nb,ie8通過,父窗體打開子窗體,之后關(guān)閉  回復(fù)  更多評(píng)論
            
          主站蜘蛛池模板: 武隆县| 民勤县| 淮安市| 大洼县| 七台河市| 江油市| 桐庐县| 平阴县| 延川县| 平潭县| 泗洪县| 会同县| 同心县| 呼伦贝尔市| 甘南县| 会昌县| 攀枝花市| 陵川县| 岑溪市| 永寿县| 喀什市| 洛阳市| 青州市| 新巴尔虎右旗| 博野县| 临城县| 兴海县| 靖边县| 三台县| 平山县| 华安县| 鲜城| 汶上县| 恩平市| 民权县| 北海市| 绵阳市| 马关县| 崇礼县| 乌拉特后旗| 千阳县|