From: Dr J R Stockton on
In comp.lang.javascript message <7144088.2XM6RcZxFs(a)PointedEars.de>,
Wed, 28 Oct 2009 21:01:01, Thomas 'PointedEars' Lahn
<PointedEars(a)web.de> posted:
>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.

Then why did you not suggest that the section be removed?


>> 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?

With a little more - with any - humility and/or common sense, you would
read what you quote both before and after composing a reply. The answer
to that question is plainly visible above, currently at the >>>> level.
Matthew 7:7, Luke 11:9.

Those verses, with their nexts, could be put in the FAQ as a
sort of motto - safely, were it not for the TL effect.



>> <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?
OAF.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE7 FF3 Op9 Sf3
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
From: Dr J R Stockton on
In comp.lang.javascript message <hca8q9$4j1$1(a)news.eternal-
september.org>, Wed, 28 Oct 2009 12:16:06, Garrett Smith
<dhtmlkitchen(a)gmail.com> posted:
>
>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.

In a FAQ, answers should be classified according to the nature of the
question, not according to the nature of the answer.

A common reasoning for questioning is that the answer is not where the
questioner thought to look.

In ordinary English, a frame, or at least an iframe, does commonly have
an innerText or textProperty property; but it is kept by one of its
descendants.

Ask the average elderly person whether they have grandchildren.
Commonly the answer will be "Yes"; it will not be "No; but I have
children who have children".

Anyway, the FAQ said "9.2 How do I access a frame's content?", rightly
omitting any reference to the structure within the frame.

--
(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: Thomas 'PointedEars' Lahn on
Dr J R Stockton wrote:

> Thomas 'PointedEars' Lahn posted:
>> 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.
>
> Then why did you not suggest that the section be removed?

Because I was not aware of its existence to date (obviously I never had a
problem that required searching the comp.lang.javascript FAQ for it), and
because I am not absolutely certain that it is not a frequently asked
question. It is just my impression that it is not, but I may have missed
some questions (definitely those posted with standards-violating `From'
header).

>>> 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?
>
> With a little more - with any - humility and/or common sense, you would
> read what you quote both before and after composing a reply. The answer
> to that question is plainly visible above, currently at the >>>> level.

I have asked before because that implication of yours would be incorrect.
Firefox/Gecko does not lack what others have; IE/MSHTML does lack it. While
probably not in number of installations, `textContent' is the standards-
compliant approach which is supported by more current layout engines than
`innerText' is or is going to be.

> Matthew 7:7, Luke 11:9.
>
> Those verses, with their nexts, could be put in the FAQ as a
> sort of motto - safely, were it not for the TL effect.

So much for "humility and/or common sense".

>>> <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?
> OAF.

Sorry, I am not familiar with that acronym, and it is not listed on
<http://www.merlyn.demon.co.uk/acronyms.htm#Acro> or in the usual places.


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

> Thomas 'PointedEars' Lahn wrote:
>> Garrett Smith wrote:
>>> Thomas 'PointedEars' Lahn wrote:
>>>> Garrett Smith wrote:
>>>>> Dr J R Stockton wrote:
>>>>>> Thomas 'PointedEars' Lahn posted:
>>>>>>> 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.
>>> For those who did not notice that I wrote "the frame", and not the
>>> IFRAME element.
>>>
>>> Assuming a document with an iframe:
>>>
>>> var f = document.getElementsByTagName("iframe")[0];
>>> f.textContent;
>>>
>>> - will not get the text content inside the iframe's document.
>>
>> Of course not; it will get the (alternative) text content of the element
>> node. Nobody has ever implied otherwise.
>>
>>> f.contentDocument.body.textContent
>>>
>>> will (where available).
>>>
>>> Hopefully that clears up any potential ambiguity.
>>
>> Your evading the issue is unsuccessful. Just to remind you: Your
>> justification for not adding this to the FAQ was that `textContent'
>> "is not related to the frame", which is ridiculous.
>
> If you want to make a proposal, then do so.

I need to know first if it is a FAQ to begin with. In any case, I have made
the potential proposal already.

> The proposal was:
>
> | I see. Then why did you not suggest that <FAQENTRY> it should be
> | included in the frame-content section (9.2) of the FAQ?
>
> Is this the issue I evaded?

No, the issue that you are evading is that the approach using `textContent'
is a possible and useful answer to this question.

> As I stated, textContent is not related to the frame; stating otherwise,
> as the proposal for section (9.2) "9.2 How do I access a frame's
> content?" would be misleading (counterproductive to FAQ goals). [...]

No, it would not. `text*Content*' clearly addresses the issue of accessing
a frame's *content*.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
From: Garrett Smith on
Dr J R Stockton wrote:
> In comp.lang.javascript message <hca8q9$4j1$1(a)news.eternal-
> september.org>, Wed, 28 Oct 2009 12:16:06, Garrett Smith
> <dhtmlkitchen(a)gmail.com> posted:
>> 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.
>
> In a FAQ, answers should be classified according to the nature of the
> question, not according to the nature of the answer.
>
> A common reasoning for questioning is that the answer is not where the
> questioner thought to look.
>
> In ordinary English, a frame, or at least an iframe, does commonly have
> an innerText or textProperty property; but it is kept by one of its
> descendants.
>

The IFRAME element and the frame (as in frames[0] or
anIframe.contentWindow), are different.

It is important to be clear on the distinction. These are technical
terms, not ordinary English terms.

> Ask the average elderly person whether they have grandchildren.
> Commonly the answer will be "Yes"; it will not be "No; but I have
> children who have children".
>
So what?

> Anyway, the FAQ said "9.2 How do I access a frame's content?", rightly
> omitting any reference to the structure within the frame.
>
The "content" would be in the document.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/