Page 1 of 1

Can you refresh an entire page, from within an iframe?

Posted: Thu Jul 14, 2011 9:47 am
by simonmlewis
I have an iframe inside a PHP page that refreshes every 10 seconds.
But it needs to be able to dominate the PHP file under certain conditions.

One query needs to be able to refresh the overall PHP file and perform a function.

How do you refresh the page (redirect, or however you wish to term it) that is the 'parent' page holding the iframe?

I've seen many Javascripts but they all seem terribly complicated. I am sure there must be a way to do this easier.
Rather than using this which just refreshes the frame itself:

Code: Select all

<meta http-equiv='Refresh' content='12 ;URL=frame.php'>
Is there something like that, that does the Parent?

Thanks.

Re: Can you refresh an entire page, from within an iframe?

Posted: Thu Jul 14, 2011 10:39 am
by simonmlewis
Just found this, but cannot see how it can be interpretted to use the 'parent' target.

Code: Select all

<script type="text/javascript"><!--
setTimeout('Redirect()',4000);
function Redirect()
{
  location.href = '../htmljavascript.htm';
}
// --></script>
I am NOT looking for Javascript, so this is the correct thread, unless someone knows better.

Re: Can you refresh an entire page, from within an iframe?

Posted: Thu Jul 14, 2011 11:15 am
by McInfo
If you don't already have Firebug, I highly recommend installing it.
simonmlewis wrote:I am NOT looking for Javascript
Because your "widget" is sitting in an iframe, the only way for it to affect its parent is with JavaScript.

Re: Can you refresh an entire page, from within an iframe?

Posted: Thu Jul 14, 2011 11:21 am
by simonmlewis
Thanks. I think I got it, just the other way around.
Not heard of Firebug, but will look into it.