Page is a not externally linkable
- Browsers
-- Opera Browser Usage and Support
---- How to get contentWindow of IFrameElement in opera 7?


Xuefer - 5:29 pm on Jun 6, 2003 (gmt 0)


ok, it's a display:none problem

opera7 do not present window object of iframe if it's hidden

<iframe name=... id=...>required text here</iframe>

<script>
var ifm = document.getElementById("iframeElementId");
alert(ifm.contentDocument); // null
if (self.iframeName == ifm) { // true for opera7 when iframe display:none
ifm.style.display = "block";
ifm.style.display = "none";
alert(ifm.contentDocument); // still null

setTimeout("alert(ifm.contentDocument);", 1000) // object [HTMLDocumentElement]
alert(self.iframeName == ifm); // false
}

</script>


Thread source:: http://www.webmasterworld.com/opera_browser/157.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com