"Thomas 'PointedEars' Lahn" <PointedEars@web.de> wrote in message
news:8544488.KANrExqyW2@PointedEars.de...
> Please provide attribution of quoted material, as described in
> the Netiquette Guidelines (RFC1855) and the newsgroup's FAQ.[1]
> vvvvvvvvvvvvvvvvv
> Aaron Gray wrote:
>
>>>>>> Properties are accessable but content is not on IE 6, previous
>>>>>> versions allowed access to the contents.
>>>>>>
>>>>>> Firefox allows access to the contents of an IFrame, but IE6 does not.
>>>>> Nonsense.
>>>> Try it and please send me some code that disputes this !
>>>>
>>>> I would be most greatful if you can prove me wrong.
>>> <URL:http://pointedears.de/scripts/test/dom/iframe>
>>
>> I seem to be able to read but not modify innerHTML.
>
> I overlooked that part.
>
>> I'll modify my statement :-
>>
>> IFrame content is readable but not modifiable from the parent
>> window.
>>
>> Do you agree ?
>
> That would depend on what you call "IFrame content". Try the URL again
> (I modified the document). The first and third button do work for me in
> IE 6.0 SP1 [Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)]. All
> buttons work in Firefox 1.5.0.1 [Mozilla/5.0 (X11; U; Linux i686; en-US;
> rv:1.8.0.1) Gecko/20060313 Debian/1.5.dfsg+1.5.0.1-4 Firefox/1.5.0.1].
>
>> Thurther :-
>>
>> <iframe src="document.html" name="IFrame" id="IFrame"></iframe>
>> <div id="sourceViewDiv"></div>
>>
>> document.getElementById("sourceViewDiv").innerHTML =
>> window.frames['IFrame'].document.body.innerHTML;
>
> It does not appear as if you were attempting to modify the IFrame
> document content here.
No just reading its text into a div.
>> window.alert(window.frames['IFrame'].document.body.innerHTML);
>>
>> The first script line fails but the alert works.
>
> ISTM either you have mixed up the sides of the assignment, or you have
> described the wrong problem. If the latter, you should make sure that
> you are operating on a Valid document first[2], and that
> document.getElementById(...) returns an element object reference.[3]
> "The first script line fails" is no error report.[4]
It was returning null.
Your example shows the modification of IFrame innerHTML working.
Looks like it is a timing error in my code. Doing mods explicitly to the
IFrame on loading the parent document causes a 'null' value for that
documents body.
Many thanks for your help Thomas,
Aaron
Received on Mon May 1 04:43:40 2006