Forum Moderators: open

Message Too Old, No Replies

Frame ref does not work in firefox

Frame ref does not work in firefox

         

Holloway

4:19 pm on Jul 26, 2005 (gmt 0)

10+ Year Member



Hi all,
We have just decided to upgrade our LMS so that it is compatible with FireFox as well as IE. I am follow the W3C DOM recommendations to the letter to ensure compatibility (well thats the idea anyway).

My prob is I want to execute javascript that is in topframe.js from mainframe.js. This is the function in main.js:


function hideTopToolbars()
{
parent.TopFrame.hideNavigationBar();
parent.TopFrame.hideBreadCrumbTrail();
}

which should call (and does in IE):

function hideNavigationBar()
{
document.getElementById('TopNavigationBar_tbl').style.display='none';
}


function hideBreadCrumbTrail()
{
document.getElementById('BreadCrumbTrail_tbl').style.display='none';
}

It works fine in IE and I have checked it at [w3schools.com ]

Im new to FireFox so i guess im doing something glaringly obvious. Any help would be most appreciated.

jfjet

2:50 am on Jul 27, 2005 (gmt 0)

10+ Year Member



How about posting your html? Not many can help you if we don't know what your HTML code is like.

Holloway

8:04 am on Jul 27, 2005 (gmt 0)

10+ Year Member



Hi,
Sorry about that. Here is the html, not sure exactly how much you require but this snippet shows the javascript declaration and the call to the hideTopToolbars(){..}:


<HTML>
<HEAD>
<script language="javascript" type="text/javascript" src="../JavaScript_Pages/mainframe.js"></script>
</HEAD>

<body onload="setTimeout('hideTopToolbars()',50);">


<form id="Main_frm" method="post" runat="server">
</form>
....table containing image.
</body>
</html>

The mainframe page calls the hideTopToolbars() in mainframe.js:

function hideTopToolbars()
{
parent.TopFrame.hideNavigationBar();
parent.TopFrame.hideBreadCrumbTrail();

}


, which then calls:

function hideNavigationBar()
{
document.getElementById('TopNavigationBar_tbl').style.display='none';
}


function hideBreadCrumbTrail()
{
document.getElementById('BreadCrumbTrail_tbl').style.display='none';
}

in topframe.js. The html in topframe page is:


<html>
<head>
<script language="javascript"type="text/javascript" src="../JavaScript_Pages/TopFrame.js"></script>
</head>
<body style="overflow:hidden;">
<table id="TopFrameContainer_tbl" cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr>
<td valign="top" height="56px">
<div id="CheckPointLogo_div" class="CheckPointLogo">&nbsp;</div>
</td>
</tr>
<tr>
<td valign="top" height="25px">
<table id="TopNavigationBar_tbl" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" height="25px">
<table id="BreadCrumbTrail_tbl" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>

It works fine in IE but not in FireFox, though no javascript errors are displayed, it just simply does nothing when the page is loaded.

Holloway

9:55 am on Jul 27, 2005 (gmt 0)

10+ Year Member



Thanks for the help. I seemed solved the problem it seems the cache in FireFox needed to be refreshed as it was referencing an older mainframe.js file.

FireFox Grrrrr.