在项目中用子窗口处理完业务后刷新父窗口,在IE6下,调用reload方法是可以刷新的,但是在IE7下该方法却没用,不知道为什么,有谁能解释下吗.不管我用window.dialogArguments传参数接收父窗口还是用window.opener都不行.最后没办法,只能用最原始的方法,将其父窗口href再次附给其本身,让其手动定向到本身,这样是可以刷新的.但为什么用reload方法就不行呢,有哪位高手能解释下吗

解决方案 »

  1.   

    IE 7 简体中文下 showModelessDialog 打开子窗口后可以刷新父窗口!!!L@_@K// Parent ====================================================
    <!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>Parent</title>
     </head> <body onload="document.title=new Date();">
    <input type="button" id="btnOpen" value="Open ChildPage" />
    <script type="text/javascript">
    <!--
    var oOpen = document.getElementById("btnOpen");
    oOpen.onclick = function() {
        window.showModelessDialog("childPage.html",window);
    };//-->
    </script>
     </body>
    </html>
    // Child ====================================================
    <!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>Child</title>
     </head> <body>
    <h3>Child Page</h3>
    <input type="button" id="btnReload" value="Reload ParentPage" />
    <script type="text/javascript">
    <!--
    var parentWindow = window.dialogArguments;
    //alert();
    var oReload = document.getElementById("btnReload");
    // 注意看父窗体的 Title 变化。
    oReload.onclick = function() {
        parentWindow.location.reload();
    };//-->
    </script>
     </body>
    </html>
      

  2.   


    // 注意看父窗体的 Title 变化。
    oReload.onclick = function() {
        parentWindow.location.reload();
    };改为// 注意看父窗体的 Title 变化。
    oReload.onclick = function() {
    // false Default. Reloads the page from the browser cache. 
    // true Reloads the page from the server. 
        parentWindow.location.reload(true);
    };