onload事件就是网页打开的时候触发的,你直接在B页面最后加
<script>
window.close()
</script>
不行吗?

解决方案 »

  1.   

    是啊在</body>后加
    <script>
    window.close()
    </script>
    就可以了
      

  2.   

    wen1818(冷月孤心) menrock(做人要厚道) :窗口B是别的网站的页面,我无法写入。各位,还有别的办法吗?
      

  3.   

    meizz(梅花雪) :我可以关闭窗口B,就是无法在窗口B的onload事件出现时再关闭它。
      

  4.   

    直接 
    var WindowB = window.open("http://www.daqing.net");
    fclose();function fclose()
    {
      WindowB.close(); 
    }不行吗??
      

  5.   

    顶多就这样了:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <script language="javascript">
    var qq;
     function aa(){
       qq=window.open("http://www.csdn.net");  
       wclose();
     }
     function wclose(){
       qq.close();
     }
    </script>
    <body>
    <input type="button" onClick="aa()">
    </body>
    </html>