定义一个 flag 标示 show.htm 是否打开
setTimeOut(...)

解决方案 »

  1.   

    function openwindow() {
     wnd = window.open(newURL,"","width=600,height=300,top=150,left=150");
    }
    1.setTimeOut(openwindow(),1000)
    2.onunload=openwindow() 3 wnd = window.open(newURL,"","width=600,height=300,top=150,left=150");
    <script Language="JavaScript">
    var wnd;
    function window_unload(){
      if(wnd) {
        wnd.close();
      }
    }
     </script>
      

  2.   

    function openwindow() {
     wnd = window.open(newURL,"","width=600,height=300,top=150,left=150");
    }
    1.setTimeOut("openwindow()",1000)
    2.onunload=openwindow() 3 wnd = window.open(newURL,"","width=600,height=300,top=150,left=150");
    <script Language="JavaScript">
    var wnd;
    function window_unload(){
      if(wnd) {
        wnd.close();
      }
    }
     </script>