比如说
A窗口->B窗口->C窗口
以上都是用的window.open()方式。我如何在A窗口里改变C窗口的属性?比如说改变C窗口的URL,然后刷新?

解决方案 »

  1.   

    var C = window.open();
    C.url = 'http://www.baidu.com';
      

  2.   

    to:MuBeiBei
    这么写的话,在IE8下会不会新弹出一个窗口??变成D窗口了?
      

  3.   


    在你C窗口不也是window.open弹出的吗前面写个变量接受,然后改url就成了
      

  4.   


    你应该是B窗口里面有window.open这个,这个应该就是C窗口
    在B窗口里写
    var C = window.open();
    C.url = '';
      

  5.   


    问题是我现在想从A窗口直接改变C窗口的URL,然后刷新。。
    我在A窗口里能直接获得C窗口的对象吗?(中间隔一层B窗口)
      

  6.   

    我刚才试了一下,IE新开了一个窗口,而不是在C窗口上刷新。。
      

  7.   

    A 里面写var b=window.open("b",urlb);b里面写var c=window.open("c",urlc);A里面写alert(b.c.document.body.innerHTML());但是得保证b c里面的页面加载完毕
      

  8.   

    A页面:
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head><body>
      <input id="stop" type="button" value="stop" />
      <input id="start" type="button" value="start" />
      <script type="text/javascript">
      
      var b;
      document.getElementById('stop').onclick = function(){
    b = window.open('B.html');
      };
      
      var c = setInterval(function(){
    if(document.getElementById('start').value == 'true'){
    b.c.window.location = '11111111111111';

    }   
      },1000);
      </script></body>
    </html>
    B页面:
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文11111档</title>
    </head><body>
    <input id="stop" type="button" value="stop" />
    <script type="text/javascript">
      
      var c;
      document.getElementById('stop').onclick = function(){
    c = window.open('C.html');
    opener.document.getElementById('start').value = 'true';
      };
      </script>
    </body>
    </html>
    C页面:
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head><body>

    </body>
    </html>