If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Can't get iframe's document property

VERIFIED INVALID

Status

()

Core
DOM
P3
blocker
VERIFIED INVALID
18 years ago
8 months ago

People

(Reporter: Syd Logan, Assigned: vidur (gone))

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
var listFrame = top.document.getElementById("MyList");
	dump( "listFrame " + listFrame + "\n" );
	DumpDOM( listFrame );
	var listDocument = listFrame.document;

MyList is an iframe.
The first dump generates:

listFrame [object HTMLIFrameElement]

DumpDOM shows:

--------------------- DumpDOM ---------------------
<IFRAME name="AddBuddyGroupList" class="AddBuddyGroupList" src="about:blank" id=
"AddBuddyGroupList">
----------- IFRAME -----------
  <HTML>
    <HEAD>
    <BODY>
--------- End IFRAME ---------
------------------- End DumpDOM -------------------

If I do a dump of the listDocument variable, I get:

listDocument = undefined

But, according to my documentation for iframes, document should be a property of
an iframe.

I need this document to be able to dynamically add content to the iframe
document.
(Assignee)

Updated

18 years ago
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → INVALID
(Assignee)

Comment 1

18 years ago
You should be able to get your document off the window associated with the
iframe - top.frames["MyList"].document should work. Not sure what you're
documentation says, but neither the W3C spec, nor our 4.x JS documentation, nor
IE's documentation has document as a property of the IFRAME element.

Marking the bug INVALID, but cc:ing Tom Pixley to see if he thinks we should
implement it nonetheless.
(Reporter)

Comment 2

18 years ago
The documentation was Dynamic HTML, danny Goodman, O;Reilly publishers. The
iframe documentation (as I read it) says that document is DOM level 1 property
of iframe, supported also by IE4, but not supported by NS (as of the writing of
the book, e.g., 4.x and earlier). I figured because it was listed there as being
supported in DOM level 1, that we would support it in 5.0.

I'll try the workaround. Thanks.

Comment 3

18 years ago
I see no document property for HTMLIFrameElement in W3C spec either. However,
HTMLIFrameElement inherits the ownerDocument property from Node. Try:

var listDocument = listFrame.ownerDocument;
dump( "listDocument " + listDocument + "\n" );

I hope it helps.

Updated

18 years ago
Status: RESOLVED → VERIFIED

Comment 4

18 years ago
Verified on W3C specs.
You need to log in before you can comment on or make changes to this bug.