Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Refresh parent page with iframes on any click

    Hi,

    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

  • #2
    Regular Coder
    Join Date
    Aug 2008
    Location
    Northern Ireland
    Posts
    167
    Thanks
    12
    Thanked 6 Times in 6 Posts
    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?

  • #3
    New Coder
    Join Date
    Jan 2009
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts
    It would but only if it refreshes the parent page as well. Is that possible?

  • #4
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post
    Maybe this will help?
    ----------------
    Code:
    Parent window's content:
    
        <b>iframe starts here</b><br><br>
        <iframe src='iframe1.html'></iframe>
        
        <br><br>
        <b>iframe ends here</b>
    	
        <script type="text/javascript">
            function change_parent_url(url)
            {
    	    document.location=url;
            }		
        </script>
    Iframe's content:
    
        IFRAME content<br><br>
    
         <a href="javascript:parent.change_parent_url('http://yahoo.com');"> 
    	Click here to change parent URL </a>

  • Users who have thanked Dazed for this post:

    martinrab (01-29-2009)

  • #5
    New Coder
    Join Date
    Jan 2009
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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!!!!!!!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •