WORKING WITH NETSCAPE FRAMES

It's possible for CGI.pm scripts to write into several browser panels and windows using Netscape's frame mechanism. There are three techniques for defining new frames programmatically:

  1. Create a document After writing out the HTTP header, instead of creating a standard HTML document using the start_html call, create a <FRAMESET> document that defines the frames on the page. Specify your script (with appropriate parameters) as the SRC for each of the frames.

    There is no specific support for creating <FRAMESET> sections in CGI.pm, but the HTML is very simple to write. See the frame documentation in Netscape's home pages for details

      http://home.netscape.com/assist/net_sites/frames.html
    

  2. Specify the destination for the document in the HTTP header You may provide a -target parameter to the header method: print $q->header(-target=>'ResultsWindow');

    This will tell Netscape to load the output of your script into the frame named ``ResultsWindow''. If a frame of that name doesn't already exist, Netscape will pop up a new window and load your script's document into that. There are a number of magic names that you can use for targets. See the frame documents on Netscape's home pages for details.

  3. Specify the destination for the document in the
    tag You can specify the frame to load in the FORM tag itself. With CGI.pm it looks like this:

        print $q->startform(-target=>'ResultsWindow');
    

    When your script is reinvoked by the form, its output will be loaded into the frame named ``ResultsWindow''. If one doesn't already exist a new window will be created.

The script ``frameset.cgi'' in the examples directory shows one way to create pages in which the fill-out form and the response live in side-by-side frames.