Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Header Location Change of Parent Frame

I have an iFrame that does some background processing. When this processing is complete I would like to re-direct the user to another page, but the header change code is only affecting the embedded iFrame. Is there a way to target the main window?

like image 216
Dan Hanly Avatar asked Aug 20 '10 13:08

Dan Hanly


3 Answers

I have seen the deprecated Meta redirect have a target attribute, but I don't know how widely it is supported.

In Javascript:

top.location.href = "resultpage.htm";

Works only if the top frame is on the same domain as the emitting page.

For a solution that works across domains and without Javascript, the following would work:

<a href="resultpage.htm" target="_top">Continue</a>
like image 153
Pekka Avatar answered Sep 28 '22 20:09

Pekka


Use JavaScript to track content of frame, if content change, redirect browser :)

like image 41
canni Avatar answered Sep 28 '22 20:09

canni


We can use javascript like this:

target.window.location='locationpage.php';

parent.window.location='index.php';
like image 45
bungdito Avatar answered Sep 28 '22 19:09

bungdito