H
Howard Jess
[Also asked in a private Opera newsgroup.]
In a javascript-heavy page, an iframe is created to hold information
from a secondary server CGI process, and the resulting data (in the
iframe) is used to rewrite some content in the main page. To do this
transparently, the iframe is created with style="display: none".
This scheme works great in IE and Mozilla; but Opera apparently doesn't
load the frame, for some reason. We've seen this behavior using this code
and the Javascript shell at http://www.squarefree.com/shell/shell.html
(a great resource):
1 ifr = document.createElement('iframe');
2 ifr.style.display = 'none';
3 ifr.height = 500;
4 ifr.width = 500;
5 ifr.src = 'http://myserver/simpletest.html';
6 document.body.appendChild(ifr);
7 ifr.style.display = '';
(While running this script, I have a telnet session open on the server,
watching Apache's log file: tail -f access_log.)
Lines 1-4: Create the iframe element and set some attributes.
Line 5 : Specify the source document.
This doesn't prompt any server activity. I pause for a
moment.
Line 6 : Attach the iframe to the current document. Using Mozilla
Firefox and Internet Explorer, I see the request on the
Apache log file. Not so when I use Opera.
Line 7 : Reset the "display" CSS attribute. When I use Opera, the
file request happens after this line is executed.
Playing around a bit, we've noticed that Opera *does* request the file
immediately after line 6 for style="position: fixed; visibility: hidden",
rather than "display: none". But this causes the space for the IFRAME to
be rendered (empty) on the page ... not what we want.
Compounding this problem is that writing code that detects this condition
seems difficult, but we don't want to resort to browser sniffing.
Help?
Howard Jess
In a javascript-heavy page, an iframe is created to hold information
from a secondary server CGI process, and the resulting data (in the
iframe) is used to rewrite some content in the main page. To do this
transparently, the iframe is created with style="display: none".
This scheme works great in IE and Mozilla; but Opera apparently doesn't
load the frame, for some reason. We've seen this behavior using this code
and the Javascript shell at http://www.squarefree.com/shell/shell.html
(a great resource):
1 ifr = document.createElement('iframe');
2 ifr.style.display = 'none';
3 ifr.height = 500;
4 ifr.width = 500;
5 ifr.src = 'http://myserver/simpletest.html';
6 document.body.appendChild(ifr);
7 ifr.style.display = '';
(While running this script, I have a telnet session open on the server,
watching Apache's log file: tail -f access_log.)
Lines 1-4: Create the iframe element and set some attributes.
Line 5 : Specify the source document.
This doesn't prompt any server activity. I pause for a
moment.
Line 6 : Attach the iframe to the current document. Using Mozilla
Firefox and Internet Explorer, I see the request on the
Apache log file. Not so when I use Opera.
Line 7 : Reset the "display" CSS attribute. When I use Opera, the
file request happens after this line is executed.
Playing around a bit, we've noticed that Opera *does* request the file
immediately after line 6 for style="position: fixed; visibility: hidden",
rather than "display: none". But this causes the space for the IFRAME to
be rendered (empty) on the page ... not what we want.
Compounding this problem is that writing code that detects this condition
seems difficult, but we don't want to resort to browser sniffing.
Help?
Howard Jess