Followup-to: comp.lang.javas cript only
Ra*********@hot mail.com wrote:
...[something.htm]
<div id=work>hello</div>
...[somethingelse.h tm]
<IFRAME id="thisframe" src="./something.htm"> </IFRAME>
<iframe name="thisframe " src="./something.htm"> </iframe>
<script>
document.frames ("thisframe").g etElementById(" work").innerHTM L =
- frames collection are a property of the window object, not of the
document.
- you can access a single frame within the frames collection with
frames["FrameName"] or with frames.FrameNam e but not with
frames("IframeI d"). You're confused in the correct way to access a frame.
- when accessing a frame, the returned object is a window object, not a
document.
- contentDocument is a property of the iframe object which can return a
reference to the document contained in the iframe. So assuming:
<iframe id="idIframe" ...></iframe>
then you can access such iframed document like this:
document.getEle mentById("idIfr ame").contentDo cument
"goodbye"
</script>
Thank you
<head>
....
<script type="text/javascript">
function PopulateIframe( )
{
var IframedDocument Body = frames["thisframe"].document.body;
var FirstParg = document.create Element("p");
FirstParg.appen dChild(document .createTextNode ("goodbye")) ;
IframedDocument Body.appendChil d(FirstParg);
}
</script>
</head>
<body onload="Populat eIframe();">
....
Not tested but should work in Mozilla-based browsers.
DU
Followup-to: comp.lang.javas cript only
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.5 :)