Refreshing frames

Discussion in 'Javascript' started by Evan, Oct 19, 2004.

  1. Evan

    Evan Guest

    Let me just start by saying... and I truly do mean this... I HATE
    frames. Now that I have that out of my system, unfortnualty I do not
    have a choice and am forced to use the complex structure that I am so
    SO needing help with. My framesets look like this

    ---------------------
    | title |
    |--------------------
    | buttons |
    |--------------------
    | base |
    |--------------------

    inside the base frame I have ANOTHER frameset... split into frmLeft
    and frmRight... now if your mind isnt tied into knots... I am sure
    this will do it... I have a button called 'add category', which is on
    the buttons frame. When I click the button, I get a popup with the
    details... I add the category details... then I need the frame titled
    frmLeft to refresh. Is this possible ? I know it is just one line of
    code by I might as well be trying to work out the formula for time
    travel !

    Any help would be appreciated

    Evan
    Evan, Oct 19, 2004
    #1
    1. Advertising

  2. Evan

    Lee Guest

    Evan said:
    >
    >Let me just start by saying... and I truly do mean this... I HATE
    >frames. Now that I have that out of my system, unfortnualty I do not
    >have a choice and am forced to use the complex structure that I am so
    >SO needing help with. My framesets look like this
    >
    >---------------------
    >| title |
    >|--------------------
    >| buttons |
    >|--------------------
    >| base |
    >|--------------------
    >
    >inside the base frame I have ANOTHER frameset... split into frmLeft
    >and frmRight... now if your mind isnt tied into knots... I am sure
    >this will do it... I have a button called 'add category', which is on
    >the buttons frame. When I click the button, I get a popup with the
    >details... I add the category details... then I need the frame titled
    >frmLeft to refresh. Is this possible ? I know it is just one line of
    >code by I might as well be trying to work out the formula for time
    >travel !


    From the popup window, the attribute you need to refresh is

    opener.parent.frmLeft.location

    Depending on what you mean by refresh, you might want either:


    opener.parent.frmLeft.location.refresh(true);
    or

    opener.parent.frmLeft.location = someURL;

    Here's an example that sets the location to a new URL.
    Don't let the fact that I define the HTML for each frame in
    script overwhelm you. The string value for each frame's
    HTML is exactly what would appear in each separate file:



    <html>
    <head>
    <script type="text/javascript">
    var titleHTML= "<html><body><h1>Title<\/h1><\/body><\/html>";

    var buttonHTML= [ "<html><body><button onclick='",
    "window.open(\"javascript:eek:pener.top.popupHTML\",",
    "\"popup\",\"width=200,height=200,resizable\")'",
    ">add category<\/button>",
    "<\/body><\/html>"].join("");

    var popupHTML= [ "<html><body><button onclick='",
    "opener.parent.frmLeft.location=",
    "\"http://www.google.com\";self.close()'>",
    "Google<\/button>",
    "<\/body><\/html>"].join("");

    var frmLeftHTML= "<html><body><h3>frmLeft<\/h3><\/body><\/html>";
    var frmRightHTML= "<html><body><h3>frmRight<\/h3><\/body><\/html>";
    </script>
    </head>
    <frameset rows="20%,30%,*">
    <frame name="title" src="javascript:top.titleHTML">
    <frame name="buttons" src="javascript:top.buttonHTML">
    <frameset cols="50%,*">
    <frame name="frmLeft" src="javascript:top.frmLeftHTML">
    <frame name="frmRight" src="javascript:top.frmRightHTML">
    </frameset>
    </frameset>
    </html>
    Lee, Oct 19, 2004
    #2
    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. Refreshing frames

    , Oct 7, 2005, in forum: Java
    Replies:
    2
    Views:
    487
    Roedy Green
    Oct 8, 2005
  2. Jules
    Replies:
    7
    Views:
    4,713
    Robert Frost-Bridges
    Sep 6, 2004
  3. Jim Hudd

    Refreshing a frames page

    Jim Hudd, Sep 25, 2004, in forum: HTML
    Replies:
    3
    Views:
    414
    Dan Abrey
    Sep 27, 2004
  4. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    457
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  5. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    185
    Harlan Messinger
    Aug 3, 2006
Loading...

Share This Page