homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Browsers / Opera Browser Usage and Support
Forum Library, Charter, Moderator: open

Opera Browser Usage and Support Forum

How to get contentWindow of IFrameElement in opera 7?

 6:49 am on Jun 4, 2003 (gmt 0)




 8:58 am on Jun 4, 2003 (gmt 0)

contentWindow is IE only, non-standard code.

Just assign your iframe an id and access it that way.


 10:48 am on Jun 4, 2003 (gmt 0)

i just wrote "contentWindow" to express what i need

in IE:
<iframe id="a"></iframe>
var a = document.getElementById('a');
i get [object]

and u think i can get a.self instead of a.contentWindow.self in opera 7?

and how do u document.write into a iframe?


 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>

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


Global Options:
 top home search open messages active posts  

Home / Forums Index / Browsers / Opera Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved