a.html
代码是<a href="b.html" target="_blank">试试</a>点 试试 就打开了b.html 只要跳出窗口就行  
我想关闭b.html关闭是在a.html
平常是在b.html关闭的不知道在a.html能不能把b.html关闭如果可以请给出代码
无限感谢!

解决方案 »

  1.   

    这样写可以控制function flashWin(elem){
    var win = window.open(elem.href);
    setTimeout(function(){
    win.close();
    }, 2000);
    return false;
    }
    <a href="inner.html" onclick="return flashWin(this);">试试</a>
      

  2.   

    我意思是a.html有一个链接打开 有一个链接关闭
    但a窗口一直在b窗口是新窗口
      

  3.   

    很容易
        <script type="text/javascript">
        var win;
        function openWin()
        {
            win=window.open("b.html",'newwindow');
        }
        function closeWin()
        {
            win.close();
        }
        </script><a href="javascript:openWin()">打开</a>
    <a href="javascript:closeWin()">关闭</a>