make sure it is called inside a frame whose parent window is opened through <a ..> or window.open (..) or <form target="..." ..>

解决方案 »

  1.   

    alert(parent.opener);
    在我的机器上显示object,在别的机器上显示undefined
      

  2.   

    top.opener该窗口必须是window.open或target=
      

  3.   

    我是在页面A.jsp中写<a target=new href=B.jsp>
    B.jsp 中是:
    <frameset cols="131,*" rows="*" border="0" framespacing="0"> 
      <frame name="left" src="C.jsp">
      <frame name="base" src="D.jsp">
    </frameset>
    然后在D.jsp中写的javascript:alert(parent.opener);
    我的真正目的是将D.jsp中的数据传回A.jsp
    但是在我的IE6上可以,跑到别的IE5上就不行。
    可是我觉得这个功能不算什么新功能阿
      

  4.   

    这跟IE的版本有关系。要IE5.5以上才支持该属性