Problem with Firefox Popup and Frames

Discussion in 'Javascript' started by Bill H, Feb 7, 2005.

  1. Bill H

    Bill H Guest

    I run a dbms application that interfaces with the web. This module creates
    a frames page with two frames ('main' and 'mwinfoframe'). All communication
    with the dbms is routed through the 'mwinfoframe' (it's sort of hidden in
    that it is assigned 1% (so I can view it in IE).

    I'm having problems with Firefox working properly while both IE 6 and
    Netscape v7.x work as expected. The following is additional information.

    A list of reports is displayed in the main frame. The main frame starts
    like:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <HTML>
    <HEAD>
    <TITLE>Customer Direct Access Menu</TITLE>
    <META Http-Equiv="Cache-Control" Content="no-cache">
    <META Http-Equiv="Pragma" Content="no-cache">
    <META Http-Equiv="Expires" Content="0">

    <BASE href="http://asibill/advantos/">

    <LINK rel="stylesheet" href="styles/styles.css">
    <SCRIPT language="JavaScript1.2" src="dwmain.js"></SCRIPT>
    </HEAD>
    ..
    ..

    When a user selects a report the request goes to the web server through the
    mwinfoframe.

    <A href="javascript:getHrefRedirect('myReport&myKey=arhist')">
    A/R History</A>

    Several functions reside in a standard included javascript page and looks
    like:

    // Close popup window
    function closePopUp() {
    if (window.winPopUp && !window.winPopUp.closed) {
    winPopUp.close();
    }
    }
    // Close popup document
    function closePopUpDocument() {
    winPopUp.document.close();
    }
    // The following is used as a conduit to the dbms
    function getHrefRedirect(dbmsScript) {
    var myHREF = '/cgi-bin/dbmsscript.exe?myexec=' + dbmsScript ;
    parent.mwinfoframe.location = myHREF;
    }
    // Open pop-up window
    function openPopUp() {
    if (!window.winPopUp || window.winPopUp.closed) {
    winPopUp =
    window.open('','mwQuery','width=575,height=400,toolbar=0,status=0');
    }
    }
    // Manage winPopUp window
    function writePopUp(TextLine) {
    winPopUp.document.write(TextLine);

    The script executes on the dbms and returns the following which runs in
    'mwinfoframe' and creates a PopUp window like:

    <HTML>
    <META Http-Equiv="Cache-Control" Content="no-cache">
    <META Http-Equiv="Pragma" Content="no-cache">
    <META Http-Equiv="Expires" Content="0">

    <HEAD></HEAD>

    <SCRIPT LANGUAGE="JavaScript">
    <!-- hide for non-supporting browsers

    TextLine = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"\n'
    TextLine += ' "http://www.w3.org/TR/html4/loose.dtd">\n'
    TextLine += '<HTML>\n'
    TextLine += '<HEAD>\n'
    TextLine += ' <TITLE>Data Prompt</TITLE>\n'
    TextLine += ' <BASE href="http://asibill/advantos/">\n'
    TextLine += ' <LINK rel="stylesheet" href="styles/styles.css">\n'
    TextLine += '</HEAD>\n'
    TextLine += '<BODY bgcolor="#FFFFFF">\n'
    TextLine += '<FORM Method="GET"\n'
    TextLine += ' action="/cgi-bin/dbmsscript.exe"\n'
    TextLine += ' NAME="mwReports"\n'
    TextLine += ' TARGET="main">\n'
    ..
    ..
    parent.main.openPopUp();
    parent.main.writePopUp(TextLine);

    TextLine = More Stuff
    parent.main.writePopUp(TextLine);

    TextLine = More Stuff
    ..
    ..
    TextLine += '</FORM>\n'
    TextLine += '</BODY>\n'
    TextLine += '</HTML>\n'
    parent.main.writePopUp(TextLine);

    parent.main.closePopUpDocument();
    // end of script hiding -->
    </SCRIPT>
    </HTML>

    When the user selects a couple of report variables then clicks on the
    [Submit]" button the report script will run and is supposed to return output
    to the main frame. The main frame's <Body> tag looks like:

    <BODY bgcolor="#FFFFFF"
    text="#000000"
    topmargin="0"
    leftmargin="0"
    marginheight="0"
    marginwidth="0"
    onLoad="MM_displayStatusMsg('');"
    onUnload="javascript:closePopUp();">

    and should close the PopUp window and the report should appear in the "main"
    frame.

    This works fine on IE 6 and all versions of Netscape through v7.2. However,
    in Firefox, instead of the report returning to the "main" frame of the
    parent page, it opens up a completely new page and fails to close the PopUp.
    All subsequent activity within this module no longer functions properly as
    we're now outside the frameset.

    Any ideas if there's a configuration option in Firefox or I'm doing
    something wrong?

    Thanks,

    Bill
     
    Bill H, Feb 7, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Philip
    Replies:
    3
    Views:
    1,021
    Karl Groves
    Jun 28, 2004
  2. Replies:
    1
    Views:
    1,041
    dorayme
    Feb 10, 2006
  3. Replies:
    0
    Views:
    1,226
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    599
    Randy Webb
    Jun 19, 2004
  5. Chris Geerdink

    location.href, a popup and frames

    Chris Geerdink, Jun 25, 2004, in forum: Javascript
    Replies:
    3
    Views:
    332
    kaeli
    Jun 29, 2004
Loading...

Share This Page