Three options:

  1. build your page such that the two frames that you wish to update are contained within another (nested) frameset. Your script writes the containing frameset and causes itself to be called again to write each of the pages within it. 3 cgi calls for each page: very bad. Doesn't require any javascript, though.
  2. Drop a little javascript in the header of the mainFrame page when you generate that, such that it sends the top frame to a new address that you've built from your cgi parameters. This doesn't necessarily work across domain boundaries, requires javascript, and causes two cgi calls per page. I remember using this approach on oneworld back when netscape 2 first came out (creak. mutter.) and feeling really groovy. ymmv.
  3. get rid of the frames. If you're regenerating most of the page anyway, what's the point? they just get in your way and annoy your visitors. Put the navigation on the page and send it all out at once. One cgi call, no javascript.
  4. This question comes up a lot on the web authoring lists and nearly always indicates that frames are the wrong approach, imho. If you're going to that much trouble, go the rest of the way and use TT2.


    In reply to Re: passing variables to multiple frames by thpfft
    in thread passing variables to multiple frames by suggus

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  5. Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  6. Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  7. Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  8. Please read these before you post! —
  9. Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  10. You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  11. Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  12. See Writeup Formatting Tips and other pages linked from there for more info.