title: javascript redirect on parent
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/580669/redirect-parent-window-from-an-iframe-action-using-javascript">Redirect parent window from an iframe action using JavaScript</a>  </p>
  </blockquote>
  
  
  
  <p>I have a page with an iframe and in content of this iframe have a redirection on all window, how can I make this?</p>
  
  <p>Tried: </p>
  
  <p><code>window.location.href = 'logged.html';</code> </p>
  
  <p>I can get if the page is opened in a frame or a up? </p>
  
  <pre><code> if(isiframe) window.top.location.href
  </code></pre>
  
  <p>--- solution ---</p>
  
  <pre><code>if($("#cboxOverlay", top.document).length &gt; 0)
    if($("#cboxOverlay", top.document).css("display") != 'none')
      window.top.location.href = '{{ path('portada') }}';
  </code></pre>