Jonas Raoni wrote:
Richard Cornford escreveu:
>Jonas Raoni wrote:
>><iframedoesn't behave like the <frame>, so you won't
find your <iframeinside the "window.frames" collection.
You can reference the window object contained in an IFRAME
through the global - frames - collection, by integer index
and by NAME attribute (but not by ID attribute) in IE.
I didn't knew about it, maybe because I never used the
<iframehaha.
You declared that " <iframedoesn't behave like the <frame>, so you
won't find your <iframeinside the "window.frames" collection" based
upon zero practical experience of applying scripting to DOM
representations of IFRAME elements? Doesn't that strike you as folly,
and likely harm you credibility?
I just tested and both "id" and "name" worked on IE and
Opera, but on Firefox 2, it's added to the collection
only if I use the name property.
And if you try it on another dozen scriptable browsers you will find
pretty much the same pattern, where an IFRAME with a NAME attribute can
reliably be referenced using that name in the containing window's -
frames - collection. It is the single most reliable approach for
referencing IFRAMEs that is arable (is unknown to fail in any scriptable
browser that can employ IFAMES in the first place.
>>Grab your <iframeby using getElementById ^^
A reference to an IFRAME element is not the same as a
reference to the global/window object contained in the IFRAME.
Yes, it's needed to access the contentWindow.
But when a general strategy is available using an alternative that is
both non-standardised and only available on the newest of browsers is
acting to significantly restrict the potential of the outcome for no
good reason.
Richard.