簡體   English   中英

如何從 iFrame 內部重定向?

[英]How can I redirect from inside an iFrame?

我使用網站重定向頁面window.location.href ,它在所有流量上也可以在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>

請任何人幫助我,我想將top.location.href用於我所有的流量也用於iframe

使用: window.top.location.href

而不是: top.location.href

兩者的區別: window.top.location vs window.location

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM