<input type="button" onclick="doClick()">function doClick(){
  window.close();
  window.opener.history.back();
}
记得好像是这么写的

解决方案 »

  1.   

    在a页面中打开b的时候要保留下b的引用:
    var w = window.open("b.html");
    然后在a里面要关b的时候就使用这个引用:
    w.close();如果不保留引用的话可以通过name重新获得引用来关闭它window.open("b.html","bWindow");
    ...
    window.open("","bWindow").close();
      

  2.   

    在子窗口中可以通过opener来获得父窗口的引用:
    b.html:window.opener.location.go(-1);
    window.close();