I have a page which contains inner frame that is not displayed by
default:
<iframe id="infram" src="innerpage.html" style="display: none">
In above mentioned innerpage.html there's defined onload event as:
<body onload="javascript:parent.iframeReady();">
This works nice in Mozilla 1.1 but not so in version 1.0, not in
Netscape 7.0. It seems that body's onload event is *not* triggered
when inner frame is set not to display. Anybody knows some workaround
for this?
--
Kamil
No, the frame src page is not loaded with display: none (in Netscape 7)
so no event can be fired. You have to make the iframe element visible to
have the document loaded as the following shows
<input type="button" value="show iframe"
onclick="document.getElementById('anIframe').style.display = '';"
/>
<iframe src="javascript: '<html><body
onload=\'alert(event.type);\'>Kibology<\/body><\/html>'"
id="anIframe"
style="display: none;"
></iframe>
That problem has been recently fixed that is why you experience
different results with Netscape 6/7 and a recent Mozilla build.
The only workaround for Netscape 6/7 is not to use display: none if you
want to load the iframe but to use
<iframe style="width: 0; height: 0; visibility: hidden;"
--
Martin Honnen
http://javascript.faqts.com/
http://home.t-online.de/home/martin.honnen/jsgoddies.html