View Full Version : Refresh parent page with iframes on any click

01-28-2009, 08:32 AM

I was wondering about the following:

I have a PHP page with an iframe where I load PERL/CGI content. Now of course when I click anything on the parent page the iframe refreshes with it.

But what I really want is to have the parent page refresh when anything inside the iframe is clicked. Of course the iframe should not refresh and go to initial view then. So basically I am looking for a way to have ONLY the parent page refresh every time something in the frame is clicked or to have the parent page and the iframe refresh but with the iframe retaining the last user position.

Anyone got a clue how to do this?

Thanks, Martin :D

01-28-2009, 09:48 AM
I don't think this is possible.

You could have the iframe reload but store session information so it reloads back to the state it was before the reload, would that be of any use?

01-28-2009, 10:19 AM
It would but only if it refreshes the parent page as well. Is that possible?

01-28-2009, 09:46 PM
Maybe this will help?

Parent window's content:

<b>iframe starts here</b><br><br>
<iframe src='iframe1.html'></iframe>

<b>iframe ends here</b>

<script type="text/javascript">
function change_parent_url(url)
Iframe's content:

IFRAME content<br><br>

<a href="javascript:parent.change_parent_url('http://yahoo.com');">
Click here to change parent URL </a>

01-29-2009, 07:49 AM
Dazed, you are the man. I will try this and I will have to modify (extend) it a bit to suit my needs but this is the best clue ever. I will let you guys know as soon as I get around to implementing it.

THANKS!!!!!!!!! :D