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 4 of 4
  1. #1
    New Coder
    Join Date
    Dec 2011
    Location
    Madison, WI
    Posts
    25
    Thanks
    4
    Thanked 0 Times in 0 Posts

    can one link load 2 frames plus their frameset?

    With the help of Aerospace_Eng in a 2005 codingforums thread, now I can use one link (for example in a page about Topic 3) to load two related pages about Topic 4 (left-4.htm and right-4.htm) into the “left” and “right” iframes, using the code below.
    ___Is it possible to use this code, suitably supplemented, to also specify the frameset at “home.htm” if an external link to “right-4.htm” loads it into a browser without the frameset? (i.e. by putting a link into right-4.htm that will load it and left-4.htm into the iframe-context of home.htm)
    Code:
    <head>
    <script> function changeLink(link) { parent.right.location=link; } </script>
    </head>
    <body>
    <a href="left-4.htm" target="left" onclick="changeLink('right-4.htm'); return true">for Topic 4</a>
    </body>

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    If you are talking about loading a <frameset> into the top window, then doing so WIPES OUT all other content, including anything you were trying to put in the left and right frames.

    So what's the point in specifying the left and right frames if the frameset load will wipe them out?

    What am I missing in your question?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Dec 2011
    Location
    Madison, WI
    Posts
    25
    Thanks
    4
    Thanked 0 Times in 0 Posts
    If you are talking about loading a <frameset> into the top window, then doing so WIPES OUT all other content, including anything you were trying to put in the left and right frames.
    Could it first load the missing frameset (home.htm) into a new window (as occurs with target="blank") while it's "remembering" the commands -- to load 4-left.htm into the left-frame, and 4-right.htm into the right-frame -- so that, after the frameset is available, it can do these two link-commands? Or is this type of "remembering with delayed actions" impossible?

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    Yes, two ways:

    (1) Set a session cookie and then read it from the frameset page. Requires minimal cookies to be enabled.
    (2) Pass the information in the query string to the frameset page and have that page be ready to process the query string.

    e.g.,
    Code:
    top.location.href="myFrameSet.html?left=xyz.html&right=abc.html
    And now you just need some minimal parsing of location.search in "myFrameSet.html".

    Will that work for you?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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