refreshing two frames with only one click

Discussion in 'Javascript' started by sjoerd, Sep 26, 2003.

  1. sjoerd

    sjoerd Guest

    Hi,

    I have a web welcome-page consisting of three frames. On the left there is
    an index. The two others (above each other on the right of the screen)
    contain data related to the index-items.

    I'm looking for the possibility to refresh the two related frames when an
    index-item in the frame on the left is clicked.

    I tried this with the HREF-command but this only works for one frame at the
    time.
    <a href = "info1.htm" target = right_above>index-item_1</a>
    or
    <a href = "info2.htm" target = right_under>>index-item_1</a>

    Id there a way to solve this in java-script? Or perhaps HTML?

    Thanks,

    Sjoerd
     
    sjoerd, Sep 26, 2003
    #1
    1. Advertising

  2. sjoerd wrote:
    > Hi,
    >
    > I have a web welcome-page consisting of three frames. On the left there is
    > an index. The two others (above each other on the right of the screen)
    > contain data related to the index-items.
    >
    > I'm looking for the possibility to refresh the two related frames when an
    > index-item in the frame on the left is clicked.
    >
    > I tried this with the HREF-command but this only works for one frame at the
    > time.
    > <a href = "info1.htm" target = right_above>index-item_1</a>
    > or
    > <a href = "info2.htm" target = right_under>>index-item_1</a>
    >
    > Id there a way to solve this in java-script? Or perhaps HTML?


    <a href="info1.htm"
    target="right_above"
    onclick="if (parent.frames.right_under) {
    parent.frames.right_under.location.href = 'info2.htm';
    }
    return true;">

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Sep 26, 2003
    #2
    1. Advertising

  3. sjoerd

    Andoni Guest

    Yes, in both actually.
    In JavaScript you can use the button/link click to run a method which does a
    location.replace with the particular page names you want to put in there.

    In html you can simply have a two frame page in which the second
    (right-hand) frame is a frameset of two frames one on top of the other.

    Hope that helps,

    Andoni.


    "sjoerd" <> wrote in message
    news:bl1duk$5sj$1.nb.home.nl...
    > Hi,
    >
    > I have a web welcome-page consisting of three frames. On the left there is
    > an index. The two others (above each other on the right of the screen)
    > contain data related to the index-items.
    >
    > I'm looking for the possibility to refresh the two related frames when an
    > index-item in the frame on the left is clicked.
    >
    > I tried this with the HREF-command but this only works for one frame at

    the
    > time.
    > <a href = "info1.htm" target = right_above>index-item_1</a>
    > or
    > <a href = "info2.htm" target = right_under>>index-item_1</a>
    >
    > Id there a way to solve this in java-script? Or perhaps HTML?
    >
    > Thanks,
    >
    > Sjoerd
    >
    >
     
    Andoni, Sep 26, 2003
    #3
  4. sjoerd wrote:
    > I'm looking for the possibility to refresh the two related frames when an
    > index-item in the frame on the left is clicked.
    >
    > I tried this with the HREF-command but this only works for one frame at the
    > time.
    > <a href = "info1.htm" target = right_above>index-item_1</a>
    > or
    > <a href = "info2.htm" target = right_under>>index-item_1</a>
    >
    > Id there a way to solve this in java-script? Or perhaps HTML?


    Not in HTML.
    Using JavaScript you might try:

    <a href="info1.htm"
    target="right_above"
    onclick="
    top.frames['right_above'].location.href='info1.htm';
    top.frames['right_under'].location.href='info2.htm';
    return false;"
    >index-item_1</a>


    HTH
    Daniel
     
    Daniel Kirsch, Sep 26, 2003
    #4
  5. sjoerd

    Chef Blair Guest

    > I have a web welcome-page consisting of three frames. On the left there is
    > an index. The two others (above each other on the right of the screen)
    > contain data related to the index-items.
    >
    > I'm looking for the possibility to refresh the two related frames when an
    > index-item in the frame on the left is clicked.
    >
    > I tried this with the HREF-command but this only works for one frame at

    the
    > time.
    > <a href = "info1.htm" target = right_above>index-item_1</a>
    > or
    > <a href = "info2.htm" target = right_under>>index-item_1</a>
    >
    > Id there a way to solve this in java-script? Or perhaps HTML?
    >
    > Thanks,
    >
    > Sjoerd
    >


    Try this, MenuBar and Content are the Frame names

    <script language="JavaScript" type="text/javascript">
    function show()
    {
    parent.MenuBar.location.href='menu0.shtml';
    parent.Content.location.href='option.shtml';
    }
    </script>
     
    Chef Blair, Oct 3, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jules
    Replies:
    7
    Views:
    4,729
    Robert Frost-Bridges
    Sep 6, 2004
  2. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    470
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  3. Mc21
    Replies:
    3
    Views:
    707
    Nico Schuyt
    Nov 13, 2006
  4. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    196
    Harlan Messinger
    Aug 3, 2006
  5. Kailas

    Opening two frames on one click

    Kailas, Aug 2, 2005, in forum: Javascript
    Replies:
    1
    Views:
    72
    Kailas
    Aug 2, 2005
Loading...

Share This Page