title: How can I redirect from inside an iFrame?
body: <p>I use website redirect page <code>window.location.href</code> , its working fine on all traffic also on <code>iframe</code> traffic.</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
       window.location.href="http://newUrlLocation.com";           
   &lt;/script&gt;
  </code></pre>
  
  <p>But when I use <code>top.location.href</code> it does not redirect from inside an <code>iframe</code>.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      top.location.href="http://newUrlLocation.com";
  &lt;/script&gt;
  </code></pre>
  
  <p>Any one help me please, I want to use <code>top.location.href</code> for all my traffic also for <code>iframe</code></p>