乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      window.open打開子窗口后關(guān)閉父窗口實(shí)現(xiàn)

       simplelam 2014-11-19

      <script type="text/javascript">   

           newWindow=window.open ('http://www.baidu.com'"name""") ;   

          window.opener=null;   

          window.open("","_self");   

          window.close();   

      </script> 

      在ff中父窗口不能關(guān)閉。在地址欄里輸入about:confit找到dom.allow_scripts_to_close_windows這一項(xiàng),并把這項(xiàng)改為true就可能了 

      說明:Window對(duì)象的opener屬性與打開這個(gè)窗口的父窗口相聯(lián)系,當(dāng)訪問子窗口中的opener屬性時(shí),返回的是父窗口。通過這個(gè)屬性,可以使用父窗口對(duì)象中的方法和屬性。

       解決思路:把父窗口的父窗口聲明為null(window.opener=null),在讓父窗口自己把自己聲明為子窗口 (window.open("","_self")),這樣父窗口自己也變成“子窗口”了,當(dāng)用window.close()關(guān)閉時(shí),就不會(huì)出現(xiàn)提示框 了。

       window.open()函數(shù)說明:

        函數(shù)原型:window.open(URL,name,param)

        URL:要彈出的新的網(wǎng)頁

        name:彈出新網(wǎng)頁的名字(不是文件名),可為空。

       param:

                   height:窗口的像素高度。為與先前版本相兼容,這個(gè)參數(shù)仍然存在。但在JavaScript1.2中被innerHeight取代。

                   width:窗口的像素寬度。為與先前版本相兼容,這個(gè)參數(shù)仍然存在。但在JavaScript1.2中被innerWidth取代。

                   location:  是否顯示地址欄

                   menubar:是否顯示菜單欄

                   titlebar:    是否顯示標(biāo)題欄

                   toolbar:    是否顯示工具欄

                   resizable:指明窗口大小是否可以調(diào)整

                   top=0 窗口距離屏幕上方的象素值

                   left=0 窗口距離屏幕左側(cè)的象素值

                   status:     是否顯示狀態(tài)欄


      完整示例:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www./TR/xhtml1/DTD/xhtml1-frameset.dtd">
      <html xmlns="http://www./1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
      <title>無標(biāo)題文檔</title>
      </head>
      <body onload="openwin('http://www.baidu.com')">top
      <script>
      function openwin(url) {
      //alert(screen.width+"*"+screen.height) ;
      //openwin('left.html')

      var w = screen.width -10;
      var h = screen.height -85;
      window.open (url, '全屏窗口測(cè)試', 'height='+ h + ', width=' + w + ', top=0,left=0 , toolbar =no, menubar=no, scrollbars=no, resizeable=no, location=no, status=yes')

      window.opener=null;
      window.open("","_self");
      window.close();
      }
      </script>
      </body>
      </noframes></html>

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多