11.html
******************
<script>
function close(){
window.close();
}</script>
<input type=button value=关闭 onclick=close()>22.html
*********************<script>
function openWin()
{
window.open("11.html","","");
}</script><input type=button value=打开窗口 onclick=openWin()>

解决方案 »

  1.   

    1、opener.close();
    2、使用一个隐式的iFrame
    <iframe id="test" style="VISIBILITY: hidden"></iframe>
    <input type="button" value="打开" onclick ='window.open("1.htm","ifrm")'>
      

  2.   

    To:wangyiyun0119(wangyy) 
      你说的这个方法是在同一个页面内作的吧?我现在遇到的问题是:首先检查某个窗口是否仍显示,如果显示的话,我点“隐藏”按钮,那么它就隐藏,如果现在未显示,我点“显示”那么它就显示出来。也就是说,这两个按钮和要被控制的这个窗口它们属于不同的两个网页文件。
      

  3.   

    可以使用xmlhttp,不过我想知道你到底用来做什么?需要这样吗?目前为止我还不知道又可以检测网页隐藏或显示的函数,不过可以借用xmlhttp动态地打开或关闭窗口来达到目的