久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      javascript如何關(guān)閉當前頁面

      在javascript中,可以使用close()方法關(guān)閉瀏覽器窗口,只需要設(shè)置“window.close()”即可。close()方法可以關(guān)閉由window指定的頂層瀏覽器窗口。

      javascript如何關(guān)閉當前頁面

      本教程操作環(huán)境:windows7系統(tǒng)、javascript1.8.5版、Dell G3電腦。

      當頁面首次打開時,瀏覽器認為是不安全的并不能直接關(guān)閉當前窗口。

      只有當頁面從別的頁面打開時或者window.open()打開時,window.close()才起作用或則執(zhí)行兩次可關(guān)閉頁面。

      代碼如下:

      if (navigator.userAgent.indexOf('MSIE') > 0) { // close IE    if (navigator.userAgent.indexOf('MSIE 6.0') > 0) {       window.opener = null;       window.close();    } else {       window.open('', '_top');       window.top.close();    } } else { // close chrome;It is effective when it is only one.    window.opener = null;    window.open('', '_self');    window.close(); }

      【推薦學(xué)習(xí):javascript高級教程】

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號