homepage Welcome to WebmasterWorld Guest from 54.167.185.110
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
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?
Xuefer




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

how?
thx

 

tedster




msg:1583971
 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.

Xuefer




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

i just wrote "contentWindow" to express what i need

in IE:
<iframe id="a"></iframe>
<script>
var a = document.getElementById('a');
alert(a.contentWindow.self);
</script>
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?

Xuefer




msg:1583973
 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>

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