Possible Duplicate:
Redirect parent window from an iframe action using JavaScript
I have a page with an iframe and in content of this iframe have a redirection on all window, how can I make this?
Tried:
window.location.href = 'logged.html';
I can get if the page is opened in a frame or a up?
if(isiframe) window.top.location.href
--- solution ---
if($("#cboxOverlay", top.document).length > 0)
if($("#cboxOverlay", top.document).css("display") != 'none')
window.top.location.href = '{{ path('portada') }}';
If they are in the same domain you may use
window.top.location.href = 'logged.html';
Otherwise there are a lot of similar threads in stackoverflow:
Cross Domain URL Access from Iframe using Javascript
Redirect parent window from an iframe action using JavaScript
window.top.location.href = "http://www.yourwebsite.com"; (but the IFrame and the top window must be on the same domain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With