Refreshing frames

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Evan

    Refreshing frames

    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
  • Lee

    #2
    Re: Refreshing frames

    Evan said:[color=blue]
    >
    >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 ![/color]

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

    opener.parent.f rmLeft.location

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


    opener.parent.f rmLeft.location .refresh(true);
    or

    opener.parent.f rmLeft.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><h 1>Title<\/h1><\/body><\/html>";

    var buttonHTML= [ "<html><body><b utton onclick='",
    "window.open(\" javascript:open er.top.popupHTM L\",",
    "\"popup\",\"wi dth=200,height= 200,resizable\" )'",
    ">add category<\/button>",
    "<\/body><\/html>"].join("");

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

    var frmLeftHTML= "<html><body><h 3>frmLeft<\/h3><\/body><\/html>";
    var frmRightHTML= "<html><body><h 3>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.frmLeftHTM L">
    <frame name="frmRight" src="javascript :top.frmRightHT ML">
    </frameset>
    </frameset>
    </html>

    Comment

    Working...