亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

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

    javascript如何自動(dòng)關(guān)閉窗口

    方法:1、使用setTimeout()方法關(guān)閉,語法“setTimeout("clock();",1000);”;2、窗口沒有提示自動(dòng)關(guān)閉,語法“this.window.opener=null; window.close();”。

    javascript如何自動(dòng)關(guān)閉窗口

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

    第一種:JS定時(shí)自動(dòng)關(guān)閉窗口

    <script language="javascript"> <!-- function closewin() { self.opener=null; self.close(); } function clock() { i=i-1 document.title="本窗口將在" + i + "秒后自動(dòng)關(guān)閉!"; if(i>0)setTimeout("clock();",1000); else closewin(); } var i=10 clock(); //--> </script>

    第二種:窗口沒有提示自動(dòng)關(guān)閉的js代碼

    <script language=javascript>   <!--   this.window.opener = null;   window.close();   //-->   </script>

    擴(kuò)展資料:

    IE6-7 JS關(guān)閉窗口不提示的方法

    方法一:

    js 代碼

    function CloseWin() //這個(gè)不會(huì)提示是否關(guān)閉瀏覽器     {     window.opener=null;     //window.opener=top;     window.open("","_self");     window.close();     }

    方法二:

    open.html

    js 代碼

    function open_complex_self() {       var obj_window = window.open('close.html', '_self');       obj_window.opener = window;       obj_window.focus();      }

    close.html

    js 代碼

    window.close();

    另附:

    //普通帶提示關(guān)閉 function closeie(){ window.close(); } //關(guān)閉IE6不提示 function closeie6(){ window.opener=null; window.close(); } //關(guān)閉IE7不提示 function closeie7(){ window.open('','_top'); window.top.close(); }

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

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