walking dom - iframe

C

carlos

When I use firebug or IE developer to step through the dom, I can't
seem to view the iframe's src page childreNode elements. What I want
to be able to do is walk the dom, and when I get to an iframe element,
go through the src page's children. So for an element named <iframe
id='myFrame' src='myPage.html' />, I want to step through myPage.htm's
childNode elements. Does anyone know if this can be done, and if so,
do they know of an example?

Thanks
 
T

Thomas 'PointedEars' Lahn

carlos said:
When I use firebug or IE developer to step through the dom, I can't
seem to view the iframe's src page childreNode elements. What I want
to be able to do is walk the dom, and when I get to an iframe element,
go through the src page's children. [...]

There is no page. However, you should look at (and into) the
`contentWindow' and `contentDocument' properties of the element objects, the
latter defined in W3C DOM Level 2 HTML (HTMLObjectElement, HTMLFrameElement
and HTMLIFrameElement interfaces):

http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-38538621
http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-78799536
http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-67133006

Gecko-based user agents support both properties for `frame' and `iframe'
element nodes, and the second one for `object' element nodes:

http://xulplanet.com/references/objref/HTMLObjectElement.html
http://xulplanet.com/references/objref/HTMLFrameElement.html
http://xulplanet.com/references/objref/HTMLIFrameElement.html

Apparently version 5.5+ of the MSHTML DOM (I have only the standalone
versions to test with 6.0 and before) supports only the first property:

http://msdn2.microsoft.com/en-us/library/ms533692(VS.85).aspx

The IE Developer Toolbar (if that is what you meant) is inferior to Firebug
also in the regard that it displays neither property even if supported.


HTH

PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Staff online

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top