self.parent.document.location.href="xxx.htm"

解决方案 »

  1.   

    对不起,看错了。
    试试:opener.window.location.href="xxx.htm"
      

  2.   

    <a href=asdf target=_opener>asdf</a>
      

  3.   

    各位大哥,都不行啊,出现opener.window为空,或不是对象??
      

  4.   

    opener.window.location.href="xxx.htm"一句加在新开的窗口中,并确保原窗口未被关闭
      

  5.   

    onclick=opener.window.location.href="xxx.htm"??不行啊!
      

  6.   

    父窗口onclick=window.open("abc.html";"";"")
    子窗口onclick=opener.window.location.href="xxx.htm"
    出现opener.window为空,或不是对象?我是彻底被打败了!
      

  7.   

    父窗口:onclick=window.open("b.htm";"";"")
    子窗口:onclick=opener.window.location.href="xxx.htm"
    出现opener.window为空,或不是对象??我是彻底被打败了!
      

  8.   

    子窗口:onclick=opener.location.href="xxx.htm"
      

  9.   

    判断一下if (window.opener!=null) window.opener.location = "";
      

  10.   

    父窗口:onclick=window.open("b.htm","","")
      

  11.   

    sorry,没有_opener,是我弄错了。可以这样:设父窗口自己的name,如<body onload="window.name='zz'">,在子窗口中的链接这样:<a href=asdf target=zz>asdf</a>这样即便父窗口关掉也不会报错,只是会打开一个name为zz的新窗口。
      

  12.   

    问题解决:
    主要是我没想到onclick是在被引入的iframe中触发的
    所以正确的是
    onclick=parent.opener.location="xxx.htm"
    多谢各位了