Re: Referncing a JS generated iframe

"Michel Carroll" <[email protected]> Thu, 20 Apr 2006 21:25:49 -0000
Newsgroups gmane.comp.web.dom.wdf
Message-ID <[email protected]>
What you say here doesn't tally with my experience. I regularly insert
iframes through the DOM (using cloneNode) and their documents are all
available through the frames collection (as in
frames[i].document.getElementById(...)).

Could you be more explicit as to what you mean by "generate an iframe
on the fly"?

Michel

--- In [email protected], "Seb Frost" <seb@...> wrote:
>
> If you generate an iframe on the fly it doesn't get entered into the
> frames[] array, so you can't use that.
> 
> So I'm left with document.getElementById('myiframe');  That correctly
> returns an object.
> 
> 
> But if I have an element of ID "foo" inside that iframe how do I
reference
> that?
> 
> document.getElementById('myiframe').document.getElementById('foo');
> 
> doesn't seem to work.  The second ".document" in that line of code
seems to
> give a reference back to the main page's document element, not the
one for
> that iframe.  I've tried lots of things, but don't seem to be getting
> anywhere!
> 
> 
> This is a problem I've come across implimenting "the man in blue"'s
> widgeditor.
> 
> cheers,
> 
> - seb
>





Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wdf-dom/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/