window.navigate(window.location.href) 

解决方案 »

  1.   

    关键是在子窗口页面的onunload事件中增加对父窗口的刷新功能,其实只关子页面的问题,测试通过;<script language="javascript" type="text/javascript">
    function reshow()
    {
    window.opener.location.reload();
    }
    </script>页面的onunload事件修改:
    <body onUnload="javascrip:reshow();">
    -----------------------------------------------------------------------
    完成实验例子代码如下:
    父页面:
    -----------------------------------------------------------------------
    <!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" type="text/javascript">
    var i=0;
    function add()
    {
    i+=1;
    document.getElementById("num").innerHTML=i;
    }
    </script>
    <body>
    <p><b>FUNCTION:关闭子窗口时自动刷新父窗口</b></p>
    <div id="num">记数变化0</div>
    <input type="button" value="add" name="add" onClick="javascript:add();">
    <br>
    <a  target="_blank" href="index2.htm">sub index2</a>
    </body>
    </html>
    -----------------------------------------------------------------------子页面:
    -----------------------------------------------------------------------
    <!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" type="text/javascript">
    function reshow()
    {
    window.opener.location.reload();
    }
    </script>
    <body onUnload="javascrip:reshow();">
    子窗口关闭时刷新父窗口
    </body>
    </html>
    -----------------------------------------------------------------------
    呵呵...有点分可以加不,想加点分^=^
      

  2.   

    我原来用过你类似的情况,window.opener.reload() 可以的啊
      

  3.   


    window.parent.location.reload(); 
    http://www.w3school.com.cn/htmldom/dom_obj_window.asp