2016-05-30 7 views
0

ウェブサイトのリダイレクトページwindow.location.hrefを使用しています。そのトラフィックはすべてiframeのトラフィックでも問題ありません。iFrameの内部からどのようにリダイレクトできますか?

<script type="text/javascript"> 
    window.location.href="http://newUrlLocation.com";   
</script> 

しかし、私はtop.location.hrefを使用する場合には、iframe内側からリダイレクトされません。

<script type="text/javascript"> 
    top.location.href="http://newUrlLocation.com"; 
</script> 

いずれかが私を助けてください、私はiframe

+0

可能な複製:http://stackoverflow.com/a/3193193/298240 – TMB

+3

[iframeアクションからの親ウィンドウのリダイレクト]の可能な複製(http://stackoverflow.com/questions/580669/redirect-parent-window-from-an-iframe-action) – TMB

答えて

0

使用のためにも、私のすべてのトラフィックに対してtop.location.hrefを使用したい:window.top.location.href

の代わりに、2つの間のtop.location.href

違い:window.top.location vs window.location

関連する問題