www.webdeveloper.com
Results 1 to 4 of 4

Thread: <js> Change parent.window src then iframe src

  1. #1
    Join Date
    Apr 2012
    Posts
    2

    <js> Change parent.window src then iframe src

    Hello!

    I've come to a problem and I've got no idea how to fix this, when I press the logout button I want the website to completely refresh and then change the iframe src/href.

    Code:
    <script type='text/javascript'>
    parent.window.location='http://mydomain.com'; // parent
    window.location='http://mydomain.com/php/account.php?action=login&message=logout'; // iframe
    </script>
    My website is running iframe therefor I need to refresh parent window(to get rid of menu items when logged in) then change the iframe src to the src above.

    I know this is possible by $_GET function but I've restricted the domain so the domain can only be http://mydomain.com not *.com?logout=true etc.

    Thanks in advance!
    Soder.

  2. #2
    Join Date
    Apr 2012
    Posts
    2
    Bump!

  3. #3
    Join Date
    Jan 2011
    Posts
    123
    Not doable

  4. #4
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    If you talk about logout, that means you can create a session variable on login, so that afterwards you may simply reload the parent, using javascript, but after you have sent an AJAX request to a third PHP file which will close the session and kills the session's variables. You parent document should have a simple PHP code detector which will check if the session variable exists. If no, it should open in its iframe the "logout" document.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles