I use website redirect page window.location.href
, its working fine on all traffic also on iframe
traffic.
<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
.
<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
Use: window.top.location.href
instead of: top.location.href
Difference between the two: window.top.location vs window.location