你open页面的时候,显示open的小页面,
关闭时,在open的小页面上放一个返回按键,
使用window.open是不可能去刷新之前的页面的.
因为它们之间没有关系可言.建议你使用iframe+div
而不用window.open();

解决方案 »

  1.   

    返回放一个按钮,
    刷新使用parent.location.href = parent.location.href 
    或者parent.location.reload();
      

  2.   

    不知道你的父页面有没有转页,下面有个例子
    //a.html
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    <script>
    function open_win(){
    div1.innerHTML="已经操作了";//父页面没有转页
    window.open("b.html","","width:300px;height:200px");
    //document.write("已经操作了");//父页面已经转页,即浏览器上方的"后退"按钮有效
    }
    </script>
    </head>
    <body>
    <div id=div1>刚加载</div>
    <input type=button onclick=open_win() value="打开窗口">
    </body>
    </html>//b.html
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>b</title>
    <script>
    function return_back(){
    opener.history.go();//没有转页
    //opener.location.reload();//没有转页
    //opener.history.back();//已经转页
    //opener.history.go(-1);//已经转页
    window.close();
    }
    </script>
    </head>
    <body>
    <input type=button value="关闭" onclick=return_back()>
    </body>
    </html>
      

  3.   

    子窗口的<body>加上属性onunload="window.opener.location.replace(opener.location);"
      

  4.   

    用这种方法 就是不用在页面单独做按钮,直接点击右上的关闭按钮 然后刷新
    function window.onbeforeunload()
    {
    if(event.clientX>360&&event.clientY<0||event.altKey)
    {

    event.returnValue="OK?";
    opener.location.reload();


    }
    }LZ是想要这种效果么?
      

  5.   

    lihui_shine(浪尖賞花)告诉的方法我已经试过了,可以关闭子窗口,但是父窗口没有刷新,请各位帮我看看lihui_shine(浪尖賞花)写的代码中有什么地方需要改动,谢谢
      

  6.   

    我不是不想用s_liangchao1s(求学) 的方法,是因为我的子窗口中需要按钮进行提交,不能够直接直接点击右上的关闭按钮,所以还是请各位高手帮帮忙,看看需要修改什么地方才能使父窗口刷新。谢谢
    function return_back(){
    opener.history.go();//没有转页
    //opener.location.reload();//没有转页
    //opener.history.back();//已经转页
    //opener.history.go(-1);//已经转页
    window.close();
    }
      

  7.   

    用window.location.herf="父页面";
    看行不?
      

  8.   

    opener.location.herf=opener.location.herf;
      

  9.   

    a.htm:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>无标题页</title>
        <script>
        function refresh(str)
        {
            document.getElementById("txt").value=str;
        }
        </script>
    </head>
    <body>
        <input id="txt" type="text"  />
        <input id="Btn" type="button" value="打开子页面" onclick="window.open('b.htm')" /></body>
    </html>b.htm:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>无标题页</title>
        <script>
        function passValue()
        {
            var pass=document.getElementById("txt2").value;
            window.opener.refresh(pass);
            window.focus();
            window.opener=null;
            window.close();
        }
        </script>
    </head>
    <body>
    <input type="text" id="txt2" value="这是我传给你的,你要收好了" />
    <input type="button" value="传值并刷新" onclick="passValue()" />
    </body>
    </html>这个就是你要的效果