Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

iFrames, CSS, and Firefox caching

1 view
Skip to first unread message

Aman

unread,
Feb 20, 2006, 5:50:04 PM2/20/06
to
Hi,

We have an iFrame on each of our web pages that is used for displaying popup
menus (we must use iFrames because these menus need to appear on top of
applets....DIVs alone don't work).

Whenever the user mouses over a menu title, we popup a menu by dynamically
filling in the HTML for the iFrame, and making the iFrame visible. The menu
content for the iFrame is retrieved from various DIVs in the page (as shown
in the following JavaScript code):

-------------------------
...
var lMenuElement = document.getElementById( iOnMenu ); // iOnMenu
is a variable indicating the id of the menu DIV to be shown
var lPopupMenuIframe = document.getElementById(
"idPopupMenuIFrame" );
var lPopupDoc = lPopupMenuIframe.contentDocument;

lPopupDoc.open( "text/html", "replace" );
lPopupDoc.write( '<html><head><title>Menu</title><link
rel="StyleSheet" href="/servlet/main.css" /></head>' );
lPopupDoc.write( '<body style="overflow:hidden; border:0">' );
lPopupDoc.write( lMenuElement.innerHTML );
lPopupDoc.write( '</body></html>' );
lPopupDoc.close();
....
--------------------

Note that we link to an external stylesheet for formatting within the
iFrame. This approach works well...until the user navigates back to the
page using the back for forward buttons. For example, if the user navigates
forward to a page, and then comes back to the original page using the Back
button, the content of the iFrame menus lose all their formatting. So it
seems as though the iFrame cannnot load the external stylesheet for some
reason. If the page is refreshed, then the menus work fine again.

When the user navigates back using the back button, the resources for the
page are retrieved from the cache, and not from the server. I suspect this
has something to do with the problem....seems like the iFrame cannot load
the stylesheet from the cache. Has anybody experienced this, or does
anybody know of a workaround? Is this a bug with Firefox?

Thanks,
Aman


Boris Zbarsky

unread,
Feb 20, 2006, 6:42:48 PM2/20/06
to
Aman wrote:
> lPopupDoc.write( '<html><head><title>Menu</title><link
> rel="StyleSheet" href="/servlet/main.css" /></head>' );

That'll probably break with history navigations because I suspect we end up
using the wrong baseURI for the document, then. Pretty sure we have a bug on this.

-Boris

Aman

unread,
Feb 21, 2006, 12:07:25 AM2/21/06
to
Perhaps it is related to bug 31667.
 
"Boris Zbarsky" <bzba...@mit.edu> wrote in message news:T9adnRyb5ph...@mozilla.org...
0 new messages