B
bruce barker
the name and id assigned to frame are only known to its parent (as its the
name of a child frame), as there is no html element in the frame source that
represents the window, the windows id and name are always null.
<html>
<body id=mainBody>
<!--
local javascript can refer to the following frame by the id, or using
the frames collection. but javascript in the frame
will not see this name, because its only know here. ex:
window.frames['foo'].name will return null.
-->
<iframe name=foo id=foo>
</iframe>
</body>
</html>
you can put a name or id on the body and check that.
window.parent.document.body.name;
-- bruce (sqlwork.com)
However before it attempts to access the parent IFrame method it needs to
know if its parent is truley an IFrame and the correct IFrame.
parent's IFrame ID. For example window.parent.id should return the name of
the IFrame's parent but for some reason the id is always null. The same is
true for an IFrame's name.
name of a child frame), as there is no html element in the frame source that
represents the window, the windows id and name are always null.
<html>
<body id=mainBody>
<!--
local javascript can refer to the following frame by the id, or using
the frames collection. but javascript in the frame
will not see this name, because its only know here. ex:
window.frames['foo'].name will return null.
-->
<iframe name=foo id=foo>
</iframe>
</body>
</html>
you can put a name or id on the body and check that.
window.parent.document.body.name;
-- bruce (sqlwork.com)
Each child IFrame needs to access its parent IFrame's javascipt methods.MLibby said:How can I access an IFrame's id or name from within a child IFrame?
My application can have nested IFrames (one IFrame exists within another).
However before it attempts to access the parent IFrame method it needs to
know if its parent is truley an IFrame and the correct IFrame.
parent IFrame's ID however, I found that child IFrame can't retrieve thierI tried assigning each IFrame an ID and then having each IFrame check its
parent's IFrame ID. For example window.parent.id should return the name of
the IFrame's parent but for some reason the id is always null. The same is
true for an IFrame's name.
that method in hopes of retriving its IFrame ID, ie.I also tried seing if the child's parent contains a method and then call