Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

passing variables to multiple frames

by suggus (Sexton)
on Oct 08, 2001 at 23:26 UTC ( [id://117532]=perlquestion: print w/replies, xml ) Need Help??

suggus has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

I'm trying to send a variable to two cgi files...is that possible? Here's the lowdown:

1) I have 3 files in a frameset(navigation.cgi, top.cgi, parse.cgi).
2) In navigation.cgi, I have a link "http://www.somehere.com/parse.cgi?file=aaa.exp" and targeting it to the mainFrame (parse.cgi).

What I would like to do is pass the parameter in the URL to top.cgi as well as to parse.cgi. Is this possible? Or am I just speaking jibberish?

If so, how would one go about completing this task?

-Gus

Replies are listed 'Best First'.
Re: passing variables to multiple frames
by shadox (Priest) on Oct 09, 2001 at 00:03 UTC
    Ummm, tell me if i am wrong, you have something like this
    -------------- | | | | | B | | | | | A |-------| | | C | | | | --------------

    And what you want to do is press a link in A , and affect both B and C ?
    Well , if i am right, then what you need is just a little javascript trick
    I know i've use it before, but i am not sure about the code, so the best i can do for you is tell you the URL where i did find the answer: Here
    Good Luck
    Dreams they just disapear into the shadows,
    then they become true....
Re: passing variables to multiple frames
by John M. Dlugosz (Monsignor) on Oct 08, 2001 at 23:46 UTC
    If I understand you correctly, I've done just that with my photo album. Have CGI generate the whole frameset page that contains the pointers to the two panes. Target that to the main window.

    —John

Re: passing variables to multiple frames
by thpfft (Chaplain) on Oct 09, 2001 at 04:18 UTC

    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.

      I failed to mention that one of the output frames is plain text only and the other frame is html. That's the reason I need to use frames... I'm still having problems though.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://117532]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-03-29 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found