为什么单击的时候 b.html
中的脚本
window.top.document.all.EEE.outerHTML=document.all.SSS.innerHTML;不能将值返回来 a.html。

解决方案 »

  1.   

    现在需要 单击的时候 将值返回到 a.html 中。系统提示 window.top.document.all.EEE 为空或不是对象。请问如果才能解决。。
      

  2.   

    a.html 可以写成这样子window.loginFrame.location.replace('b.html')但是不好用,可是见到别人这样写就可以用。
      

  3.   

    a.html 引用 b.html 从 b.html 返回值 到 a.html
      

  4.   

    loginFrame是一个框架页的子框架的名称,所以这样用就好用。
      

  5.   

    你可以这样用
    -------------a----------------
    <html>
    <head></head><body><input type="text" value="请单击" onClick="javascript:window.open('b.html');"><div id="eee">090</div>
    <script language="javascript">
    <!--
    ev = document.all.eee.outerHTML;
    //alert(ev);
    //-->
    </script></body>
    </html>-----------b-----------------
    <html>
    <head></head><body>
    <div id=SSS>
    <font color=red size=4>b.html</font>
    </div><script type="text/javascript">
    obj = window.opener.document.getElementById('eee');
    //alert(obj);
    obj.outerHTML=document.all.SSS.innerHTML;
    </script>
    </body>
    </html>
      

  6.   

    window.location.replace('b.html')这条语句中的replace方法使得b.html的URL替换了当前的a.html,这样在history对象的历史记录里面就不会有a.html存在,所以你再返回的时候,浏览器在历史记录中就找不到中a.html也就不能返回了.
      

  7.   

    to gu1dai(异域苍穹......追夢人) 你说 loginFrame 是子框架 ,你能将代码写出来吗??上面的方法要开新窗口。
    <script type="text/javascript">
    obj = window.opener.document.getElementById('eee');
    //alert(obj);
    obj.outerHTML=document.all.SSS.innerHTML;
    window.close(); /**************  加条关闭窗口 *********************/
    </script>不过还是有窗口弹出来。我也知道 loginFrame 但就不知道怎么用。
      

  8.   

    to gu1dai(异域苍穹......追夢人)在你的提醒下,问题自己解决了。谢谢提示。to xinyunyishui(心云意水) 你可能去睡觉了,但是问题解决。