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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Location
    Germany
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Load frame 2 on onLoad frame 1

    When page "actual.htm" is started in frame 1 I want to load "new.htm" in frame 2 automatically.

    When page "actual.htm" is closed in frame 1 I want to load "old.htm" in frame 2 automatically.

    Can anybody tell me the syntax for this actions?

    THX a lot.
    Last edited by Smiley2; 07-16-2003 at 01:02 AM.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    use <IFRAME> tags for include your pages, give them ID's, than use a simple DHML (in parent page!, called from child with something like parent. function()...) script to window.open() or window.close() or, better, to change the SRC within the IFRAME tags
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    in actual.htm:

    <html>
    <head>
    <script type="text/javascript">
    window.open("new.htm","name of frame 2");
    </script>
    </head>
    <body onunload="window.open('old.htm','name of frame 2')">
    ...
    </body>
    </html>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    I might be wrong, but i think so:

    <body onunload="window.parent.open('old.htm','name of frame 2')">

    I am not very sure that you can comunicate directly fron a child to another. I think you musr refere the parent than to "tell" parent to open/close the other child...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    ... because 'name of frame 2' is defined in parent body, so that there is no 'name of frame 2' defined in the frame1's body...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    the 2nd parameter of window.open() is the window name of the target window, frame or iframe.

    if the supplied target name is not existing, the page will be opened in a new window with that specified target as window name, otherwise, it will be opened in the EXISTING window/frame/iframe with that target name.

    The four reserved target names are _blank, _parent, _self, and _top which mean new unnamed window, parent window/frame/iframe, current window/frame/iframe and outermost window, respectively.

    window.open() is similar with anchor links, <a href="..." target="...">

    the only difference is the default target for window.open() is "_blank" and for anchor links is "_self".

    hope you understand my explanation.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #7
    New to the CF scene
    Join Date
    Jun 2003
    Location
    Germany
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank you all

    Hello Kor and Glenn,

    thank you for your good help. I could solve my problem with your syntax examples perfectly.
    If you want to see the result (the page - although finished - is not yet officially released) you can look at

    http://www.ggt-online.de/GGTindex

    Look for the owl "Jule" (appears only once on the first page to introduce herself). She appears another time on "Geschäfte/Reisen".


  •  

    Posting Permissions

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