From: Dr J R Stockton on
In comp.lang.javascript message <3363483.cEBGB3zze1(a)PointedEars.de>,
Tue, 27 Oct 2009 19:38:40, Thomas 'PointedEars' Lahn
<PointedEars(a)web.de> posted:
>Dr J R Stockton wrote:
>
>> I want to read as on disc, certainly; but my needs are substantially
>> satisfied for TXT files by what innerText and innerHTML show, and for
>> HTML files by what is actually revealed.
>>
>> It's annoying that Firefox seems to lack innerText of iframe content,
>
>It implements the `textContent' property instead, like any other browser
>standards-compliant in that regard. (Discussed here ad nauseam).

I see. Then why did you not suggest that <FAQENTRY> it should be
included in the frame-content section (9.2) of the FAQ? It's still
annoying that one major browser lacks what others have (even if out of
fashion), especially if the functionality is present.


>Suppose `iframe' refers to the object implementing the HTMLIFrameElement
>interface, then you are looking for
>
> iframe.contentDocument.documentElement.textContent
>
>That is, if the layout engine (like Gecko) wraps the content of a text/plain
>resource in a markup (HTML-like) document. More precise would be

You should know better than to suggest, or appear to suggest, writing
engine-dependent code in the default Web context.


> iframe.contentDocument.body.textContent
>
>then. I remember to have posted that explanation before, but the FAQ had
>not been updated for some reason.

Yes, the FAQ maintainer clearly does not understand how the job should
be done. If a change is worth making (and there is either no doubt or a
reasonable consensus), then it is worth making immediately.



<FAQENTRY> FAQ 9.7 : ISTM that there may be another cause, or a
refinement of that one. Firefox 3.0.14 gives me "Permission denied to
get property HTMLDocument.anchors" on approximately the 150th time of
doing what seems to be essentially the same thing

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
From: Garrett Smith on
Dr J R Stockton wrote:
> In comp.lang.javascript message <3363483.cEBGB3zze1(a)PointedEars.de>,
> Tue, 27 Oct 2009 19:38:40, Thomas 'PointedEars' Lahn
> <PointedEars(a)web.de> posted:
>> Dr J R Stockton wrote:
>>
>>> I want to read as on disc, certainly; but my needs are substantially
>>> satisfied for TXT files by what innerText and innerHTML show, and for
>>> HTML files by what is actually revealed.
>>>
>>> It's annoying that Firefox seems to lack innerText of iframe content,
>> It implements the `textContent' property instead, like any other browser
>> standards-compliant in that regard. (Discussed here ad nauseam).
>
> I see. Then why did you not suggest that <FAQENTRY> it should be
> included in the frame-content section (9.2) of the FAQ? It's still
> annoying that one major browser lacks what others have (even if out of
> fashion), especially if the functionality is present.
>
>
>> Suppose `iframe' refers to the object implementing the HTMLIFrameElement
>> interface, then you are looking for
>>
>> iframe.contentDocument.documentElement.textContent
>>
>> That is, if the layout engine (like Gecko) wraps the content of a text/plain
>> resource in a markup (HTML-like) document. More precise would be
>
> You should know better than to suggest, or appear to suggest, writing
> engine-dependent code in the default Web context.
>
>
>> iframe.contentDocument.body.textContent
>>
>> then. I remember to have posted that explanation before, but the FAQ had
>> not been updated for some reason.
>

The innerText/textContent is not related to the frame; its' related to
elements. The frame is a window.

As I've stated before, neither are available in Blackberry9000.

> Yes, the FAQ maintainer clearly does not understand how the job should
> be done. If a change is worth making (and there is either no doubt or a
> reasonable consensus), then it is worth making immediately.
>
>
>
> <FAQENTRY> FAQ 9.7 : ISTM that there may be another cause, or a
> refinement of that one. Firefox 3.0.14 gives me "Permission denied to
> get property HTMLDocument.anchors" on approximately the 150th time of
> doing what seems to be essentially the same thing
>
I'm busy with several different edits to the FAQ and have not gotten to
a good stopping point.

Did you post an example of code that causes the error?
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
From: Thomas 'PointedEars' Lahn on
Dr J R Stockton wrote:

> Thomas 'PointedEars' Lahn posted:
>> Dr J R Stockton wrote:
>>> I want to read as on disc, certainly; but my needs are substantially
>>> satisfied for TXT files by what innerText and innerHTML show, and for
>>> HTML files by what is actually revealed.
>>>
>>> It's annoying that Firefox seems to lack innerText of iframe content,
>>
>> It implements the `textContent' property instead, like any other browser
>> standards-compliant in that regard. (Discussed here ad nauseam).
>
> I see. Then why did you not suggest that <FAQENTRY> it should be
> included in the frame-content section (9.2) of the FAQ?

Because I do not think it is a frequently asked question.

> It's still annoying that one major browser lacks what others have (even if
> out of fashion), especially if the functionality is present.

Which browser would that be?

>>Suppose `iframe' refers to the object implementing the HTMLIFrameElement
>>interface, then you are looking for
>>
>> iframe.contentDocument.documentElement.textContent
>>
>>That is, if the layout engine (like Gecko) wraps the content of a
>>text/plain
>>resource in a markup (HTML-like) document. More precise would be
>
> You should know better than to suggest, or appear to suggest, writing
> engine-dependent code in the default Web context.

No, because I am aware of the concept of graceful degradation supported by
feature-testing. You should know better than to assume that I would
recommend to use this code untested.

>> iframe.contentDocument.body.textContent
>>
>>then. I remember to have posted that explanation before, but the FAQ had
>>not been updated for some reason.
>
> Yes, the FAQ maintainer clearly does not understand how the job should
> be done. If a change is worth making (and there is either no doubt or a
> reasonable consensus), then it is worth making immediately.

ACK

> <FAQENTRY> FAQ 9.7 : ISTM that there may be another cause, or a
> refinement of that one. Firefox 3.0.14 gives me "Permission denied to
> get property HTMLDocument.anchors" on approximately the 150th time of
> doing what seems to be essentially the same thing

SOP?


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
From: Garrett Smith on
Thomas 'PointedEars' Lahn wrote:
> Dr J R Stockton wrote:
>
>> Thomas 'PointedEars' Lahn posted:
>>> Dr J R Stockton wrote:

[snip]

>>> then. I remember to have posted that explanation before, but the FAQ had
>>> not been updated for some reason.
>> Yes, the FAQ maintainer clearly does not understand how the job should
>> be done. If a change is worth making (and there is either no doubt or a
>> reasonable consensus), then it is worth making immediately.
>
> ACK
>
If there is another reason for complaining, it has not been provided.

I've heard the complaint about innerText/textContent not being mentioned
in relation to frames and replied.

As I explained, the innerText/textContent is not related to the frame;
it is related to elements. An entry on getting frame's
innerText/textContent implies that a frame has a property
innerText/textContent. That would be false.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
From: Thomas 'PointedEars' Lahn on
Garrett Smith wrote:

> Dr J R Stockton wrote:
>> Thomas 'PointedEars' Lahn posted:
>>> Suppose `iframe' refers to the object implementing the HTMLIFrameElement
>>> interface, then you are looking for
>>>
>>> iframe.contentDocument.documentElement.textContent
>>>
>>> That is, if the layout engine (like Gecko) wraps the content of a
>>> text/plain
>>> resource in a markup (HTML-like) document. More precise would be
>>
>> You should know better than to suggest, or appear to suggest, writing
>> engine-dependent code in the default Web context.
>>
>>> iframe.contentDocument.body.textContent
>>>
>>> then. I remember to have posted that explanation before, but the FAQ
>>> had not been updated for some reason.
>
> The innerText/textContent is not related to the frame; its' related to
> elements. The frame is a window.

The (i)frame window is represented by a Window instance; the `iframe'
element is not (AISB). Apparently you still need to learn the difference
between element objects and other host objects.

> As I've stated before, neither are available in Blackberry9000.

Negligibly small Blackberry market share¹ notwithstanding, that is not
a good reason for ignoring any of the presented solutions at all.
That is, provided it is a frequently asked question to begin with.


PointedEars
___________
¹ <http://stats.getjar.com/statistics/world/manufacturer/BlackBerry>
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)