问题描述如下:
点击主页A中的某个超链接,弹出页面B,然后点击页面B中的某个超链接,弹出页面C,同时自动关闭页面B,,,,,,,等等,假如一直到页面X,有没有办法,在最末层的页面X,调用一段代码,刷新祖先页面A??也就是利用js,刷新指定的页面A?无论在哪个阶段,可以固定刷新指定的页面A?

解决方案 »

  1.   

    不多说,上代码
    a.htm
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>a</title>
    </head><body>
    当你可以再次点击按钮说明该页面已经刷新过
    <input type=button id="b" value="open b" onclick="window.open('b.htm');this.disabled=true;">
    </body></html>
    b.htm
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>b</title>
    <script defer>
    var a = window.opener;
    window.open("c.htm");
    </script>
    </head><body></body></html>
    c.htm
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>c</title>
    <script defer>
    var b = window.opener;
    var a = b.a;
    b.close();
    a.location = a.location;
    </script>
    </head><body></body></html>
      

  2.   

    上面的应该可以的,将上面的代码a.location = a.location;改成a.location.reload();试试
      

  3.   

    试试, 每次打开新窗口时,都把A 传给新打开的窗口即,每次都是open("....").winA = window.winA || window;最后弹出的窗口用window.winA.location.reload();
      

  4.   

       function RefreshThislist()
            {
                location.href=window.location.href;           
            }