In one application where the majority of the work is done with Javascript, upon need the Javascript code builds up a form in one of the frames and submits it. The results then come back to the same frame and are displayed.

Some people have used invisible frames to interact with CGIs. It's just like normal CGI, except that you take care not to reset the frameset.

As for parameter sharing among frames, the usual idea is to have variables declared outside of the individual frames, plus some Javascript routines to manage transfering data around between the frames.

If I sound vague it's because it has been awhile set I set one of those up... three years since I last touched it. Here's some disconnected (and ugly (and old (very old))) snippets: From the first CGI:

sub CopyHTMLToBrowserPart1 { print <<"EOT"; Content-type: text/html <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-88 +59-1"> <META NAME="Copyright" CONTENT="Copyright (C) 1998 Yes-sir-this- +is-my-baby Consulting All rights reserved."> <META NAME="Author" CONTENT="me"> <META NAME="Description" CONTENT="Page to select administration ac +tions"> <TITLE>Paging Database Maintenance</TITLE> <SCRIPT LANGUAGE="JavaScript" SRC="${PagingAIJSPathWWW}vars.js" ></S +CRIPT> <SCRIPT LANGUAGE="JavaScript" SRC="${PagingAIJSPathWWW}util1.js" ></S +CRIPT> <SCRIPT LANGUAGE="JavaScript" SRC="${PagingAIJSPathWWW}subsu1.js" ></S +CRIPT> <SCRIPT LANGUAGE="JavaScript" SRC="${PagingAIJSPathWWW}subs1.js" ></S +CRIPT> <SCRIPT LANGUAGE="JavaScript"> function initFromDatabaseValues() { EOT }
These are separate routines as in-between I build up and output the large Javascript data arrays.
sub CopyHTMLToBrowserPart2 { print <<"EOT"; } initFromDatabaseValues(); // Identify AI CGI version and datestamp versionAICGI = '1.12'; dateAICGI = 'Tuesday, June 27, 2000'; // Where to submit updates; where is Send-a-Page? var PageSubmitActionURL = '$PageSubmitActionURL'; var PageSendPageURL = '$PageSendPageURL'; // Flags identifying support for enhancements var AllowUserAliasEnhancements = $AllowUserAliasEnhancements; ::: ::: // Allow comments from CGI on first screen var InitialMessage ='$JSInitialMessage'; </SCRIPT> </HEAD> <FRAMESET ROWS="160,*" FRAMEBORDER="yes" FRAMESPACING=0 BORDER=3> <FRAME SRC="${PagingAIHTMLPathWWW}blanktop.html" NAME="ftop" MARGIN +HEIGHT=0 MARGINWIDTH=5 SCRO LLING="YES"> <FRAME SRC="${PagingAIHTMLPathWWW}blankbot.html" NAME="fbot" MARGIN +HEIGHT=0 MARGINWIDTH=5 SCRO LLING="YES"> </FRAMESET> <NOFRAMES> Sorry, this page requires that you have a frames-capable browser.<BR> You will not be able to use these facilities. <P> The Netscape Navigator 3.x and Internet Explorer 3.x programs are able to display frames. Please install one of these or a more recent version. </NOFRAMES> </HTML> EOT File blanktop.html basically immediately fetches good stuff, kicking o +ff by using a Javascript onLoad="" event: <HTML><HEAD><TITLE></TITLE></HEAD> <BODY BGCOLOR="WHITE" onLoad="top.OnLoadBlankPageTop()"> </BODY></HTML>
All this was patched together from various books and hints around the web. The books are better now, I suppose. Good luck.

In reply to Re: Embedding CGI into frames? by shenme
in thread Embedding CGI into frames? by Spidy

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • 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
  • 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;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.