[英]How can I redirect from inside an iFrame?
I use website redirect page window.location.href
, its working fine on all traffic also on iframe
traffic.我使用网站重定向页面
window.location.href
,它在所有流量上也可以在iframe
流量上正常工作。
<script type="text/javascript">
window.location.href="http://newUrlLocation.com";
</script>
But when I use top.location.href
it does not redirect from inside an iframe
.但是当我使用
top.location.href
它不会从iframe
内部重定向。
<script type="text/javascript">
top.location.href="http://newUrlLocation.com";
</script>
Any one help me please, I want to use top.location.href
for all my traffic also for iframe
请任何人帮助我,我想将
top.location.href
用于我所有的流量也用于iframe
Use: window.top.location.href
使用:
window.top.location.href
instead of: top.location.href
而不是:
top.location.href
Difference between the two: window.top.location vs window.location两者的区别: window.top.location vs window.location
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.