<SCRIPT   ID=clientEventHandlersJS   LANGUAGE=javascript>   
  <!--   
  var   newweb   
  function   button1_onclick()   {   
    newweb=   window.open("b.html");   
  }    
  //-->   
  </SCRIPT>   
  </HEAD>   
  <BODY>   
  <P><INPUT   id=button1   type=button   value=打开   name=button1   LANGUAGE=javascript   onclick="return   button1_onclick()"></P>   
  <input   type=button   value=close   onclick="newweb.close()">   
  </BODY>   
  </HTML> 

解决方案 »

  1.   

    呵呵,我的意思是说用a.html打开b.html 然后如何用c.html关闭b.html 
      

  2.   

    如果C和B没有关系,比如是open的。则无法关闭其他页面,否则你敢访问我的网站,我就把你的其他页面全关了!只剩下我的!那浏览器的漏洞就太大了!!!
      

  3.   

    不行的,浏览器只允许关闭程序打开的页面,
    如果尝试关闭用户打开的页面会弹出提示对话框的!在B中加入<input type="button" name="Close" onclick="self.close();" />可以关闭B页面自己!
      

  4.   

    可以的 ,不过比较麻烦
    如果客户端允许的话 ,可以用 vbs或者js调系统的api
    先获取到 window 的 title ,然后判断 ,用 shell就可以关闭
      

  5.   

    都集成在 user32.dll 里面 ,还要先安装一个 dll ,可以通过这个dll 才能调api的汗 ,楼主的应该问下自己 为什么会有这个需求?或者采用 window.open 打开c页面的就可以
      

  6.   

    <script>
    var a;
    var b;function openWin(v) {
    if(v=="a") {
    a = window.open("http://www.163.com/","a","");
    } else if(v=="b") {
    b = window.open("http://www.qq.com/","b","");
    }
    return;
    }function closeWin(v) {
    if(v=="a") {
    a.close();
    } else if(v=="b") {
    b.close();
    }
    }
    </script>
    <input type="button" onclick="openWin('a')" value="open('a')">
    <input type="button" onclick="openWin('b')" value="open('b')">
    <input type="button" onclick="closeWin('a')" value="close('a')">
    <input type="button" onclick="closeWin('b')" value="close('b')">