Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #23200 > unrolled thread
| Started by | Cezary Tomczyk <cezary.tomczyk@gmail.com> |
|---|---|
| First post | 2014-02-22 18:21 +0100 |
| Last post | 2014-02-27 15:46 +0000 |
| Articles | 20 on this page of 42 — 9 participants |
Back to article view | Back to comp.lang.javascript
Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-22 18:21 +0100
Re: Get inner text of HMTL element Martin Honnen <mahotrash@yahoo.de> - 2014-02-22 19:31 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-22 20:51 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-22 21:11 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-22 21:37 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-22 22:05 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-22 23:38 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-23 10:43 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-23 14:50 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-23 15:48 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-24 21:01 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-24 22:34 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-27 21:41 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-27 22:32 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-28 13:44 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-28 16:54 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-03-04 20:51 +0100
Re: Get inner text of HMTL element ompalompasales2@gmail.com - 2014-03-04 12:59 -0800
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-22 20:59 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-22 22:23 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-22 23:32 +0100
Re: Get inner text of HMTL element Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-02-22 21:27 -0300
Re: Get inner text of HMTL element "se" <se@no-one.here> - 2014-02-23 05:35 +0100
Re: Get inner text of HMTL element Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-02-23 15:29 -0300
Re: Get inner text of HMTL element "se" <se@no-one.here> - 2014-02-23 21:01 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-23 20:02 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-23 21:55 +0100
Re: Get inner text of HMTL element Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-02-24 08:37 +0100
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-24 12:30 +0100
Re: Get inner text of HMTL element Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-02-24 15:09 -0300
Re: Get inner text of HMTL element Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-24 19:43 +0100
Re: Get inner text of HMTL element Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-02-24 18:12 -0300
Re: Get inner text of HMTL element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-24 22:51 +0100
Re: Get inner text of HMTL element Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-02-25 19:49 +0000
Re: Get inner text of HMTL element Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-02-26 05:20 -0300
Re: Get inner text of HMTL element "se" <se@no-one.here> - 2014-02-26 17:10 +0100
OT - Re: Get inner text of HMTL element Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-02-26 15:48 -0300
Re: OT - Re: Get inner text of HMTL element "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-02-26 22:43 +0100
Re: OT - Re: Get inner text of HMTL element Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-02-27 15:00 +0000
Re: OT - Re: Get inner text of HMTL element "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-02-28 10:50 +0100
Re: OT - Re: Get inner text of HMTL element "se" <se@no-one.here> - 2014-02-27 10:57 +0100
Re: Get inner text of HMTL element Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-02-27 15:46 +0000
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2014-02-22 23:32 +0100 |
| Message-ID | <1957237.G35ZFXocOO@PointedEars.de> |
| In reply to | #23209 |
Cezary Tomczyk wrote:
> Thomas 'PointedEars' Lahn wrote:
>> Cezary Tomczyk wrote:
>>> To get inner text of HTML element I've been using:
>>>
>>> function get_inner_text(node) {
>>> if (node.nodeType === 3) {
>>> return node.data;
>>> }
>>>
>>> var txt = '';
>>>
>>> node = node.firstChild;
>>> while (node) {
>>> txt += get_inner_text(node);
>>> node = node.nextSibling;
>>> }
>>> return txt.replace(/\s+/g, ' ');
>> ^^^^^^^^^^^^^^^^^^^^^^^^
>> This is _not_ equivalent to node.textContent, see
>> <http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent>.
>
> I see. In documentation I've read that "No whitespace normalization is
> performed and the returned string does not contain the white spaces in
> element content[...]."
>
> As for "whitespace normalization" I found that it's about "(spaces,
> tabs, and blank lines)" (http://www.w3.org/TR/REC-xml/#sec-white-space).
> However, "blank lines" means "new line" using \r\n or \r or \n, right?
>
> Also, how "whitespace normalization" should work? E.g. replacing " "
> to " "?
RTFSpec. However, since it says there that “*no* whitespace normalization
is performed” with “textContent”, you do not have to concern yourself with
that in “textContent” emulation.
However, ISTM that at least Chromium “Version 32.0.1700.123 Debian
jessie/sid (248368)” does not implement “textContent” as specified: “the
returned string does not (read: MUST NOT) contain the white spaces in
element content (read: “element content whitespace” as per XML), but it does
there. With
var div = document.createElement("div");
div.appendChild(document.createTextNode(" "));
var span = document.createElement("span");
span.appendChild(document.createTextNode(" "));
div.appendChild(span);
“div.textContent” yields four spaces there, but IIUC should yield only two
because the whitespace preceding the “span” element would be “element
content whitespace” per XML.
<http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.character>
The reason for that may be that the first child object implements the Text
interface of DOM Level 3 Core only incompletely: it implements the
splitText() method introduced in Level 1 Core, and the “wholeText” attribute
and replaceWholeText() method introduced in Level 3 Core; but it does not
implement the “isElementContentWhitespace” attribute also introduced in the
latter Specification.
<http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-1312295772>
<http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-1312295772>
> Any suggestions?
Yes.
<http://www.catb.org/~esr/faqs/smart-questions.html>
--
PointedEars
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Joao Rodrigues <groups_jr-1@yahoo.com.br> |
|---|---|
| Date | 2014-02-22 21:27 -0300 |
| Message-ID | <lebfaf$8r8$1@speranza.aioe.org> |
| In reply to | #23200 |
On 22-02-2014 14:21, Cezary Tomczyk wrote:
> To get inner text of HTML element I've been using:
>
> function get_inner_text(node) {
> if (node.nodeType === 3) {
> return node.data;
> }
>
> var txt = '';
>
> node = node.firstChild;
> while (node) {
> txt += get_inner_text(node);
> node = node.nextSibling;
> }
> return txt.replace(/\s+/g, ' ');
> }
>
> However, I am thinking about simplifying it and instead of:
>
> var str = get_inner_text(elm); // elm represent reference to the HTML
> element
>
> I would use now:
>
> var str = elm.textContent || elm.data || elm.innerText;
>
> Is it a good approach? Any suggestions?
>
A good approach is using feature-tests at load-time, when you test for
either textContent or innerText only once. Then, you will use one of
them in the rest of your code / library. E.g.
(function (global) {
// feature-tests at load-time.
var parseEl = document.createElement('div');
var get_inner_text;
if (typeof parseEl.textContent != 'undefined') {
// DOM Level 3 - IE9+, FF, Safari, etc.
get_inner_text = function (el) {
return (el.textContent);
};
} else if (typeof parseEl.innerText != 'undefined') {
get_inner_text = function (el) {
return (el.innerText);
};
}
global.get_inner_text = get_inner_text;
}(this));
Keep in mind the differences between textContent and innerText, though.
See https://developer.mozilla.org/En/DOM/Node.textContent
--
Joao Rodrigues
[toc] | [prev] | [next] | [standalone]
| From | "se" <se@no-one.here> |
|---|---|
| Date | 2014-02-23 05:35 +0100 |
| Message-ID | <lebtqq$3st$1@dont-email.me> |
| In reply to | #23213 |
"Joao Rodrigues" <groups_jr-1@yahoo.com.br> skrev i meddelelsen
news:lebfaf$8r8$1@speranza.aioe.org...
> A good approach is using feature-tests at load-time, when you test for
> either textContent or innerText only once. Then, you will use one of them
> in the rest of your code / library. E.g.
>
> (function (global) {
> // feature-tests at load-time.
> var parseEl = document.createElement('div');
> var get_inner_text;
> if (typeof parseEl.textContent != 'undefined') {
> // DOM Level 3 - IE9+, FF, Safari, etc.
> get_inner_text = function (el) {
> return (el.textContent);
> };
> } else if (typeof parseEl.innerText != 'undefined') {
> get_inner_text = function (el) {
> return (el.innerText);
> };
> }
> global.get_inner_text = get_inner_text;
> }(this));
>
> Keep in mind the differences between textContent and innerText, though.
> See https://developer.mozilla.org/En/DOM/Node.textContent
>
> --
> Joao Rodrigues
Why this:
if (typeof parseEl.textContent != 'undefined')
Why not just:
if (typeof parseEl.textContent)
Testing for returned value of either null or undefined, its
anough and better just doing: if (ele)
Using 'undefined' in testing often leads to an erroneous compare statment.
if using != it would be better doing it like this: if (ele!=null). As null
is a
reliable use whether returned value is undefined or null.
if (ele!=null) is the same as if (ele).
So in cases where returned value is either undefined or null,
just do: if (ele).
[toc] | [prev] | [next] | [standalone]
| From | Joao Rodrigues <groups_jr-1@yahoo.com.br> |
|---|---|
| Date | 2014-02-23 15:29 -0300 |
| Message-ID | <ledela$afm$1@speranza.aioe.org> |
| In reply to | #23214 |
On 23-02-2014 01:35, se wrote:
> "Joao Rodrigues" <groups_jr-1@yahoo.com.br> skrev i meddelelsen
> news:lebfaf$8r8$1@speranza.aioe.org...
>
>> A good approach is using feature-tests at load-time, when you test for
>> either textContent or innerText only once. Then, you will use one of
>> them in the rest of your code / library. E.g.
>>
>> (function (global) {
>> // feature-tests at load-time.
>> var parseEl = document.createElement('div');
>> var get_inner_text;
>> if (typeof parseEl.textContent != 'undefined') {
>> // DOM Level 3 - IE9+, FF, Safari, etc.
>> get_inner_text = function (el) {
>> return (el.textContent);
>> };
>> } else if (typeof parseEl.innerText != 'undefined') {
>> get_inner_text = function (el) {
>> return (el.innerText);
>> };
>> }
>> global.get_inner_text = get_inner_text;
>> }(this));
>>
>> Keep in mind the differences between textContent and innerText,
>> though. See https://developer.mozilla.org/En/DOM/Node.textContent
>
> Why this:
> if (typeof parseEl.textContent != 'undefined')
>
> Why not just:
> if (typeof parseEl.textContent)
No, because the typeof operator always returns an non-empty string. So
the if statement will evaluate the (typeof parseEl.textContent)
expression as true. You seem to be confusing "undefined" with undefined.
If ("undefined") { } // is true
If (undefined) { } // is false
See <http://ecma-international.org/ecma-262/5.1/#sec-11.4.3>
and
<http://ecma-international.org/ecma-262/5.1/#sec-12.5>
> Testing for returned value of either null or undefined, its
> anough and better just doing: if (ele)
> Using 'undefined' in testing often leads to an erroneous compare statment.
> if using != it would be better doing it like this: if (ele!=null). As
> null is a
> reliable use whether returned value is undefined or null.
> if (ele!=null) is the same as if (ele).
> So in cases where returned value is either undefined or null,
> just do: if (ele).
It is so because undefined == null and null == undefined are true and
also because the undefined value can be overwritten in ES 3. This is
whay it is safe to test against null.
--
Joao Rodrigues
[toc] | [prev] | [next] | [standalone]
| From | "se" <se@no-one.here> |
|---|---|
| Date | 2014-02-23 21:01 +0100 |
| Message-ID | <ledk3p$sk3$1@dont-email.me> |
| In reply to | #23245 |
"Joao Rodrigues" <groups_jr-1@yahoo.com.br> skrev i meddelelsen
news:ledela$afm$1@speranza.aioe.org...
> On 23-02-2014 01:35, se wrote:
>> "Joao Rodrigues" <groups_jr-1@yahoo.com.br> skrev i meddelelsen
>> news:lebfaf$8r8$1@speranza.aioe.org...
>>
>>> A good approach is using feature-tests at load-time, when you test for
>>> either textContent or innerText only once. Then, you will use one of
>>> them in the rest of your code / library. E.g.
>>>
>>> (function (global) {
>>> // feature-tests at load-time.
>>> var parseEl = document.createElement('div');
>>> var get_inner_text;
>>> if (typeof parseEl.textContent != 'undefined') {
>>> // DOM Level 3 - IE9+, FF, Safari, etc.
>>> get_inner_text = function (el) {
>>> return (el.textContent);
>>> };
>>> } else if (typeof parseEl.innerText != 'undefined') {
>>> get_inner_text = function (el) {
>>> return (el.innerText);
>>> };
>>> }
>>> global.get_inner_text = get_inner_text;
>>> }(this));
>>>
>>> Keep in mind the differences between textContent and innerText,
>>> though. See https://developer.mozilla.org/En/DOM/Node.textContent
>>
>> Why this:
>> if (typeof parseEl.textContent != 'undefined')
>>
>> Why not just:
>> if (typeof parseEl.textContent)
>
> No, because the typeof operator always returns an non-empty string. So the
> if statement will evaluate the (typeof parseEl.textContent) expression as
> true. You seem to be confusing "undefined" with undefined.
>
> If ("undefined") { } // is true
> If (undefined) { } // is false
>
> See <http://ecma-international.org/ecma-262/5.1/#sec-11.4.3>
> and
> <http://ecma-international.org/ecma-262/5.1/#sec-12.5>
>
>
>> Testing for returned value of either null or undefined, its
>> anough and better just doing: if (ele)
>> Using 'undefined' in testing often leads to an erroneous compare
>> statment.
>> if using != it would be better doing it like this: if (ele!=null). As
>> null is a
>> reliable use whether returned value is undefined or null.
>> if (ele!=null) is the same as if (ele).
>> So in cases where returned value is either undefined or null,
>> just do: if (ele).
>
> It is so because undefined == null and null == undefined are true and also
> because the undefined value can be overwritten in ES 3. This is whay it is
> safe to test against null.
Yes, that was the base-knowledge behind my information.
Agreed, program-code won't scrash testing as: if (typeof parseEl.textContent
!= 'undefined')
as typeOf always returns a string.
Yet, it's recommended not - not here at least:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined
Read this midtways down on the page:
However, this kind of technique should be avoided. JavaScript is a
statically scoped language, so knowing if a variable is defined can be read
by seeing whether it is defined in an enclosing context.
Did I confusing this - Maybe?.
>
> --
> Joao Rodrigues
[toc] | [prev] | [next] | [standalone]
| From | Cezary Tomczyk <cezary.tomczyk@gmail.com> |
|---|---|
| Date | 2014-02-23 20:02 +0100 |
| Message-ID | <ledgjm$6dm$1@dont-email.me> |
| In reply to | #23213 |
Joao Rodrigues wrote:
[...]
> A good approach is using feature-tests at load-time, when you test for
> either textContent or innerText only once. Then, you will use one of
> them in the rest of your code / library. E.g.
I agree and I've the same approach. I've presented here some basic code
which will be rewritten to test feature once and apply proper method.
> (function (global) {
> // feature-tests at load-time.
> var parseEl = document.createElement('div');
> var get_inner_text;
> if (typeof parseEl.textContent != 'undefined') {
> // DOM Level 3 - IE9+, FF, Safari, etc.
> get_inner_text = function (el) {
> return (el.textContent);
> };
> } else if (typeof parseEl.innerText != 'undefined') {
> get_inner_text = function (el) {
> return (el.innerText);
> };
> }
> global.get_inner_text = get_inner_text;
> }(this));
> Keep in mind the differences between textContent and innerText, though.
> See https://developer.mozilla.org/En/DOM/Node.textContent
Thomas Lahn pointed to that problem. It's not so easy as it looks -
getting text content from node.
--
Cezary Tomczyk
http://www.ctomczyk.pl/
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2014-02-23 21:55 +0100 |
| Message-ID | <1611166.dN4Lx1XDJs@PointedEars.de> |
| In reply to | #23248 |
Cezary Tomczyk wrote: > Joao Rodrigues wrote: > [...] >> A good approach is using feature-tests at load-time, when you test for >> either textContent or innerText only once. Then, you will use one of >> them in the rest of your code / library. E.g. > > I agree […] You have not been paying attention, then. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Cezary Tomczyk <cezary.tomczyk@gmail.com> |
|---|---|
| Date | 2014-02-24 08:37 +0100 |
| Message-ID | <leess5$rbv$1@dont-email.me> |
| In reply to | #23254 |
W dniu 2014-02-23 21:55, Thomas 'PointedEars' Lahn pisze: > Cezary Tomczyk wrote: > >> Joao Rodrigues wrote: >> [...] >>> A good approach is using feature-tests at load-time, when you test for >>> either textContent or innerText only once. Then, you will use one of >>> them in the rest of your code / library. E.g. >> >> I agree […] > > You have not been paying attention, then. Hm, what did I miss? -- Cezary Tomczyk http://www.ctomczyk.pl/
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2014-02-24 12:30 +0100 |
| Message-ID | <14369411.pZhbKGxk9O@PointedEars.de> |
| In reply to | #23258 |
Cezary Tomczyk wrote: > W dniu 2014-02-23 21:55, Thomas 'PointedEars' Lahn pisze: >> Cezary Tomczyk wrote: >>> Joao Rodrigues wrote: >>> [...] >>>> A good approach is using feature-tests at load-time, when you test for >>>> either textContent or innerText only once. Then, you will use one of >>>> them in the rest of your code / library. E.g. >>> >>> I agree […] >> >> You have not been paying attention, then. > > Hm, what did I miss? That infering from the property of one (host) object to the property of another, even if they have the same name, is error-prone. <news:2932926.BXQvjz4BgK@PointedEars.de> -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Joao Rodrigues <groups_jr-1@yahoo.com.br> |
|---|---|
| Date | 2014-02-24 15:09 -0300 |
| Message-ID | <leg1sn$tse$1@speranza.aioe.org> |
| In reply to | #23259 |
Em 24/02/2014 08:30, Thomas 'PointedEars' Lahn escreveu: > Cezary Tomczyk wrote: > >> W dniu 2014-02-23 21:55, Thomas 'PointedEars' Lahn pisze: >>> Cezary Tomczyk wrote: >>>> Joao Rodrigues wrote: [...] >>>>> A good approach is using feature-tests at load-time, when you >>>>> test for either textContent or innerText only once. Then, you >>>>> will use one of them in the rest of your code / library. >>>>> E.g. >>>> >>>> I agree […] >>> >>> You have not been paying attention, then. >> >> Hm, what did I miss? > > That infering from the property of one (host) object to the property > of another, even if they have the same name, is error-prone. > > <news:2932926.BXQvjz4BgK@PointedEars.de> > Some people in c.l.js enjoy looking for gold in a silver mine. As we're living in 2013, we'll find textContent available everywhere, unless one uses VM / Wine to fiddle with Windows Vista / IE 8 and earlier. Remember that DOM Level 3 is a W3C recommendation from 2004 - almost 10 years now. -- Joao Rodrigues (J.R.)
[toc] | [prev] | [next] | [standalone]
| From | Christoph Michael Becker <cmbecker69@arcor.de> |
|---|---|
| Date | 2014-02-24 19:43 +0100 |
| Message-ID | <530b92cd$0$9508$9b4e6d93@newsspool1.arcor-online.net> |
| In reply to | #23260 |
Joao Rodrigues wrote: > Some people in c.l.js enjoy looking for gold in a silver mine. As we're > living in 2013, we'll find textContent available everywhere, unless one > uses VM / Wine to fiddle with Windows Vista / IE 8 and earlier. Remember > that DOM Level 3 is a W3C recommendation from 2004 - almost 10 years now. According to some statistics[1], IE 8 is still the most used browser version -- it's hard to believe so many users are using a VM or Wine. ;) [1] <http://www.netmarketshare.com/browser-market-share.aspx?qprid=2&qpcustomd=0> -- Christoph M. Becker
[toc] | [prev] | [next] | [standalone]
| From | Joao Rodrigues <groups_jr-1@yahoo.com.br> |
|---|---|
| Date | 2014-02-24 18:12 -0300 |
| Message-ID | <legck4$ubu$1@speranza.aioe.org> |
| In reply to | #23261 |
Em 24/02/2014 15:43, Christoph Michael Becker escreveu: > Joao Rodrigues wrote: > >> Some people in c.l.js enjoy looking for gold in a silver mine. As >> we're living in 2013, we'll find textContent available everywhere, >> unless one uses VM / Wine to fiddle with Windows Vista / IE 8 and >> earlier. Remember that DOM Level 3 is a W3C recommendation from >> 2004 - almost 10 years now. > > According to some statistics[1], IE 8 is still the most used browser > version -- it's hard to believe so many users are using a VM or Wine. > ;) > > [1] > <http://www.netmarketshare.com/browser-market-share.aspx?qprid=2&qpcustomd=0> > > Imagine how old is a computer / operating system to not allow updating IE from version 8, considering the Microsoft's official product lifecycle: <http://support.microsoft.com/lifecycle/search/default.aspx> For sure many companies postpone the purchase of new computers for their employees which helps holdovers like Windows XP and IE 8 linger on. Nowadays, we find either the textContent (all browsers at least since 2011) or the innerText (IE <= 8) property in web browsers. Looking for a third option is like "looking for gold in a silver mine". -- Joao Rodrigues (J.R.)
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2014-02-24 22:51 +0100 |
| Message-ID | <13275422.djfYvq2R2u@PointedEars.de> |
| In reply to | #23261 |
Christoph Michael Becker wrote: > Joao Rodrigues wrote: >> Some people in c.l.js enjoy looking for gold in a silver mine. As we're >> living in 2013, we'll find textContent available everywhere, unless one >> uses VM / Wine to fiddle with Windows Vista / IE 8 and earlier. Remember >> that DOM Level 3 is a W3C recommendation from 2004 - almost 10 years now. > > According to some statistics[1], IE 8 is still the most used browser > version -- it's hard to believe so many users are using a VM or Wine. ;) > > [1] > <http://www.netmarketshare.com/browser-market-share.aspx?qprid=2&qpcustomd=0> Statistics are only as good as the method of getting the numbers for them (and the people compiling them). Web statistics usually are only as good as browser detection permits. Browser detection is only as good as the browser, and the user, permits. At this point we only know that we do not know for sure how and why such numbers came about. (An increasing concern in using Web statistics, both from Net Applications and StatCounter.com, is the increasing share of “unknown”/“other” browser versions: now about 16.38 to 60 % on StatCounter.com and 22 to 42.39 % with Net Applications. Frankly, those are becoming bad jokes of a stat.) We do know that Windows XP support is in the process of being terminated, which affects versions of Internet Explorer before 9; but again, in which timeframe and to what extent they will be affected, we do not know. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> |
|---|---|
| Date | 2014-02-25 19:49 +0000 |
| Message-ID | <j9G+kjPkPPDTFw5z@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #23260 |
In comp.lang.javascript message <leg1sn$tse$1@speranza.aioe.org>, Mon,
24 Feb 2014 15:09:47, Joao Rodrigues <groups_jr-1@yahoo.com.br> posted:
>Some people in c.l.js enjoy looking for gold in a silver mine. As we're
>living in 2013, we'll find textContent available everywhere,
On this side of the Atlantic, we're living in 2014.
You are apparently living somewhere in ".br".
Now I have a small Paulistano neighbour, also João, and I have put a
line for São Paulo in <http://www.merlyn.demon.co.uk/js-date5.htm#SLGD>
:-
São Paulo BRT3BRST,M10.3.0/00:00,M2.3.0/00:00
- but that line needs modification if Carnaval includes the third Sunday
in February - the third "3" should then be "4", in accordance with
Presidential Decree n. 6.558.
In my cited page section, the "?" button lists the years, between 2000
and 2123 inclusive, in which by the current rules the end of Brazilian
DST must be postponed by a week.
Have I got it right?
The question is on-topic because, of course, the page uses JavaScript
(and so should not work in LahnLand, since there is no such thing as
JavaScript there).
--
(c) John Stockton, nr London, UK. E-mail, see Home Page. Turnpike v6.05.
Website <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
[toc] | [prev] | [next] | [standalone]
| From | Joao Rodrigues <groups_jr-1@yahoo.com.br> |
|---|---|
| Date | 2014-02-26 05:20 -0300 |
| Message-ID | <lek852$r67$1@speranza.aioe.org> |
| In reply to | #23310 |
On 25/02/2014 16:49, Dr J R Stockton wrote:
> In comp.lang.javascript message <leg1sn$tse$1@speranza.aioe.org>, Mon,
> 24 Feb 2014 15:09:47, Joao Rodrigues <groups_jr-1@yahoo.com.br> posted:
>
>> Some people in c.l.js enjoy looking for gold in a silver mine. As we're
>> living in 2013, we'll find textContent available everywhere,
>
> On this side of the Atlantic, we're living in 2014.
Oops, my mistake.
>
> You are apparently living somewhere in ".br".
Yes, I am living in Rio de Janeiro, Brazil.
>
> Now I have a small Paulistano neighbour, also João,
People born (not just living) in São Paulo city are known as
"paulistanos"; people born in Rio like me are known as "cariocas". And
João in Portuguese means John - Brazilians speak Portuguese, not Spanish
as many believe, although there are several important differences
between European and Brazilian Portuguese.
> and I have put a
> line for São Paulo in <http://www.merlyn.demon.co.uk/js-date5.htm#SLGD>
> :-
> São Paulo BRT3BRST,M10.3.0/00:00,M2.3.0/00:00
>
> - but that line needs modification if Carnaval includes the third Sunday
> in February - the third "3" should then be "4", in accordance with
> Presidential Decree n. 6.558.
>
> In my cited page section, the "?" button lists the years, between 2000
> and 2123 inclusive, in which by the current rules the end of Brazilian
> DST must be postponed by a week.
>
> Have I got it right?
The Presidential Decree # 6.558/2008 has determined the DST ("summer
time") rules observed by some federal states of Brazil - DST terminated
on 16 Feb, 2014 (third Sunday of February) at 00:00h. The Carnival
festivities in Brazil commence on 28 Feb and terminate on 5 Mar 2014 at
noon, although some cities may extend the celebrations / parades to
other weekends because of tourism.
In 2014, the end of the Brazilian DST won't coincide with the Carnival
Sunday (02 Mar) - if it would, then the end of DST should be postponed
to the next Sunday (09 Mar), in accordance with the referred Decree.
>
> The question is on-topic because, of course, the page uses JavaScript
> (and so should not work in LahnLand, since there is no such thing as
> JavaScript there).
>
I couldn't help laughing :-)
Cheers,
João Rodrigues
[toc] | [prev] | [next] | [standalone]
| From | "se" <se@no-one.here> |
|---|---|
| Date | 2014-02-26 17:10 +0100 |
| Message-ID | <lel3m0$p9e$1@dont-email.me> |
| In reply to | #23311 |
"Joao Rodrigues" <groups_jr-1@yahoo.com.br> skrev i meddelelsen
news:lek852$r67$1@speranza.aioe.org...
> On 25/02/2014 16:49, Dr J R Stockton wrote:
>> In comp.lang.javascript message <leg1sn$tse$1@speranza.aioe.org>, Mon,
>> 24 Feb 2014 15:09:47, Joao Rodrigues <groups_jr-1@yahoo.com.br> posted:
>>
>>> Some people in c.l.js enjoy looking for gold in a silver mine. As we're
>>> living in 2013, we'll find textContent available everywhere,
>>
>> On this side of the Atlantic, we're living in 2014.
>
> Oops, my mistake.
>
>>
>> You are apparently living somewhere in ".br".
>
> Yes, I am living in Rio de Janeiro, Brazil.
>
>>
>> Now I have a small Paulistano neighbour, also João,
>
> People born (not just living) in São Paulo city are known as
> "paulistanos"; people born in Rio like me are known as "cariocas". And
> João in Portuguese means John - Brazilians speak Portuguese, not Spanish
> as many believe, although there are several important differences between
> European and Brazilian Portuguese.
>
>> and I have put a
>> line for São Paulo in <http://www.merlyn.demon.co.uk/js-date5.htm#SLGD>
>> :-
>> São Paulo BRT3BRST,M10.3.0/00:00,M2.3.0/00:00
>>
>> - but that line needs modification if Carnaval includes the third Sunday
>> in February - the third "3" should then be "4", in accordance with
>> Presidential Decree n. 6.558.
>>
>> In my cited page section, the "?" button lists the years, between 2000
>> and 2123 inclusive, in which by the current rules the end of Brazilian
>> DST must be postponed by a week.
>>
>> Have I got it right?
>
> The Presidential Decree # 6.558/2008 has determined the DST ("summer
> time") rules observed by some federal states of Brazil - DST terminated on
> 16 Feb, 2014 (third Sunday of February) at 00:00h. The Carnival
> festivities in Brazil commence on 28 Feb and terminate on 5 Mar 2014 at
> noon, although some cities may extend the celebrations / parades to other
> weekends because of tourism.
>
> In 2014, the end of the Brazilian DST won't coincide with the Carnival
> Sunday (02 Mar) - if it would, then the end of DST should be postponed to
> the next Sunday (09 Mar), in accordance with the referred Decree.
>
>>
>> The question is on-topic because, of course, the page uses JavaScript
>> (and so should not work in LahnLand, since there is no such thing as
>> JavaScript there).
>>
>
> I couldn't help laughing :-)
>
> Cheers,
> João Rodrigues
Wonder how Santos and Rio looks like today. Being there last time in year
1958,
being a young sailor onboard the coffee boats: DFDS's ships "Venezuela" and
"Colorador". Though, we called mostly for Santos. In Rio I had an experience
that
I never forget about. I and a couple of the other boys had been visited -
honestly -
Monkey town. We hired a taxi back to the harbour. When arriving to the
harbour area.
The driver steered toward a dark area, stopped the taxi, then switch on his
radio station, then
he grab a hammer and smashed the car front window and ordered us 3 boys to
deliever to him all we had of money. Even one of us was a big one - looking
stronger
than an adult person, we all 3 very fast concluded that we couldn't do
anything more
reasonable do comply with him, and we did. To day as an older, this
episode - like
other episodes that happen me through life - often calls me again and again,
and
I reconsider the Rio experience and askes myself "Could we do otherwise
than we did".
My conclusion is; we most likely did the right. This taxi-driver most likely
had connection
to some local police-officer. Otherwise he wounld't risk his skind on doing
a robbery
like that on 3 sailor-boys. We told it onboard. The captain may have
concluded the same.
Wonder if it worsen in Rio today - even in dayligh - perhaps.
Apart from above, we had some other less dramatically but perculiar
adventures in
south america. One of which, Mengele, stood on the quay in Bounos Aires for
hours,
just stareing on our ship. One of our sailors told us that our captain had
forbidden
him admittance to our ship. As far as we knew, he lived at a german
community up
near the Brazil border. By no doubt he suffered by homesickness.
[toc] | [prev] | [next] | [standalone]
| From | Joao Rodrigues <groups_jr-1@yahoo.com.br> |
|---|---|
| Date | 2014-02-26 15:48 -0300 |
| Subject | OT - Re: Get inner text of HMTL element |
| Message-ID | <lelctt$2ps$1@speranza.aioe.org> |
| In reply to | #23321 |
On 26/02/2014 13:10, se wrote: > > "Joao Rodrigues" <groups_jr-1@yahoo.com.br> skrev i meddelelsen > news:lek852$r67$1@speranza.aioe.org... >> On 25/02/2014 16:49, Dr J R Stockton wrote: >>> In comp.lang.javascript message <leg1sn$tse$1@speranza.aioe.org>, >>> Mon, 24 Feb 2014 15:09:47, Joao Rodrigues >>> <groups_jr-1@yahoo.com.br> posted: <snip> >>> You are apparently living somewhere in ".br". >> >> Yes, I am living in Rio de Janeiro, Brazil. >> >>> >>> Now I have a small Paulistano neighbour, also João, >> >> People born (not just living) in São Paulo city are known as >> "paulistanos"; people born in Rio like me are known as "cariocas". >> And João in Portuguese means John - Brazilians speak Portuguese, >> not Spanish as many believe, although there are several important >> differences between European and Brazilian Portuguese. <snip> > Wonder how Santos and Rio looks like today. Being there last time in > year 1958, being a young sailor onboard the coffee boats: DFDS's > ships "Venezuela" and "Colorador". Though, we called mostly for > Santos. These cities, as many others in Brazil, have grown several times since then. The bad thing is Brazil still exports coffee to Europe (mainly German and Italy) and imports "espresso" capsules from there - it's not clever, I know. > In Rio I had an experience that I never forget about. I and a > couple of the other boys had been visited - honestly - Monkey town. I hope you are not referring to African descendants, because I strongly condemn racism - and I descend from Portuguese (Caucasian Europeans). > We hired a taxi back to the harbour. When arriving to the harbour > area. The driver steered toward a dark area, stopped the taxi, then > switch on his radio station, then he grab a hammer and smashed the > car front window This driver was one of the world's dumbest thieves (smashing his own windshield). > and ordered us 3 boys to deliever to him all we had > of money. Even one of us was a big one - looking stronger than an > adult person, we all 3 very fast concluded that we couldn't do > anything more reasonable do comply with him, and we did. To day as an > older, this episode - like other episodes that happen me through life > - often calls me again and again, and I reconsider the Rio experience > and askes myself "Could we do otherwise than we did". My conclusion > is; we most likely did the right. This taxi-driver most likely had > connection to some local police-officer. Otherwise he wounld't risk > his skind on doing a robbery like that on 3 sailor-boys. We told it > onboard. The captain may have concluded the same. Wonder if it worsen > in Rio today - even in dayligh - perhaps. I think that in 1958 three sailors could have won a brawl with that stupid thug. Nowadays in Rio, São Paulo, Mexico City, London, Rome and many other big cities in the world we find thieves using knives / guns that rarely attack their prey without accomplices in the shadows. But of course it's more likely that someone gets hurt or is killed by a thief in Latin America than in Europe. See: <http://www.theguardian.com/uk/knifecrime> <http://www.standard.co.uk/news/crime/1000-knife-crime-victims-in-london-each-month-shocking-new-figures-show-8681511.html> > > Apart from above, we had some other less dramatically but perculiar > adventures in south america. One of which, Mengele, stood on the quay > in Bounos Aires for hours, just stareing on our ship. One of our > sailors told us that our captain had forbidden him admittance to our > ship. As far as we knew, he lived at a german community up near the > Brazil border. By no doubt he suffered by homesickness. > Yes, it seems many Nazis fled to South America in the postwar and some have been killed by the Mossad overseas. Mengele died in Brazil: <http://www.nytimes.com/1985/06/22/world/scientists-decide-brazil-skelton-is-josef-mengele.html> -- Joao Rodrigues (J.R.)
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2014-02-26 22:43 +0100 |
| Subject | Re: OT - Re: Get inner text of HMTL element |
| Message-ID | <XnsA2E0E72C2A179eejj99@194.109.133.133> |
| In reply to | #23334 |
Joao Rodrigues <groups_jr-1@yahoo.com.br> wrote on 26 feb 2014 in comp.lang.javascript: > I hope you are not referring to African descendants, because I strongly > condemn racism - and I descend from Portuguese (Caucasian Europeans). There are no "Caucasian" Europeans, I strongly object to this InnerText, as this silly and perhaps dangerous word is only used in the US, where skin colour is strangely off-limit in "decent" speech. Historically, the Portuguese descend from the pre-Celtic peoples who inhabited the Iberian Peninsula with the Lusitanians and the Gallaeci forming the manifold identity of the country, followed by the Italics, the Romans. Other major segments include the Suebi and the Visigoths. [..] The ancestry of modern Portuguese has been influenced by the many people which have passed on its territory throughout history. Overall, these people include the Pre-Roman People of the Iberian Peninsula (such as the Lusitanians, Calaicians, Celtici, Cynetes and other minor local tribes as the Bracari, Coelerni, Equaesi, Grovii, Interamici, Leuni, Luanqui, Limici, Narbasi, Nemetati, Paesuri, Quaquerni, Seurbi, Tamagani, Tapoli, Turduli, Turduli Veteres, Turdulorum Oppida, Turodi and Zoelae), and probably for some cases Romans, Vandals, Suebi and Buri, Visigoths, Vikings, Alans and Saqaliba. [..] A number of studies focus on the genetic impact of the centuries of Muslim rule in the Iberian peninsula on the genetic make up of the modern Iberian population. [..] [..] argues that the individual differences in Y-chromosome markers suggest that Iberians and Sephardic Jews must share ancestry more recent than several millennia. <https://en.wikipedia.org/wiki/Portuguese_people> <https://en.wikipedia.org/wiki/Genetic_history_of_the_Iberian_Peninsula> -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> |
|---|---|
| Date | 2014-02-27 15:00 +0000 |
| Subject | Re: OT - Re: Get inner text of HMTL element |
| Message-ID | <JOtEYFpIM1DTFw+k@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #23336 |
In comp.lang.javascript message <XnsA2E0E72C2A179eejj99@194.109.133.133> , Wed, 26 Feb 2014 22:43:30, Evertjan. <exxjxw.hannivoort@inter.nl.net> posted: >Joao Rodrigues <groups_jr-1@yahoo.com.br> wrote on 26 feb 2014 in >comp.lang.javascript: > >> I hope you are not referring to African descendants, because I strongly >> condemn racism - and I descend from Portuguese (Caucasian Europeans). > >There are no "Caucasian" Europeans, I strongly object to this InnerText, >as this silly and perhaps dangerous word is only used in the US, >where skin colour is strangely off-limit in "decent" speech. You do not know English English as well as you think you do. The word is not in my Little Oxford Dictionary, but it is not in my similar-sized Universal Webster either. It is, with that meaning, in my Penguin, Concise Oxford, and Chambers dictionaries. I believe that the Concise Oxford Dictionary is the one which best represents the range of words known among mature educated native Englishmen. I dare not venture any opinion whatsoever on the language of Englishwomen. -- (c) John Stockton, nr London, UK. For Mail, see Home Page. Turnpike, WinXP. Web <http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and links. Command-prompt MiniTrue is useful for viewing/searching/altering files. Free, DOS/Win/UNIX now 2.0.6; see my <http://www.merlyn.demon.co.uk/pc-links.htm>.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2014-02-28 10:50 +0100 |
| Subject | Re: OT - Re: Get inner text of HMTL element |
| Message-ID | <XnsA2E26E59DB33Ceejj99@194.109.133.133> |
| In reply to | #23356 |
Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> wrote on 27 feb 2014 in comp.lang.javascript: >>There are no "Caucasian" Europeans, I strongly object to this InnerText, >>as this silly and perhaps dangerous word is only used in the US, >>where skin colour is strangely off-limit in "decent" speech. > > You do not know English English as well as you think you do. I was not commenting on the British English meaning! Do you have some innate need for native superiority, John? > The word is not in my Little Oxford Dictionary, but it is not in my > similar-sized Universal Webster either. It is, with that meaning, in my > Penguin, Concise Oxford, and Chambers dictionaries. What meaning? White? > I believe that the Concise Oxford Dictionary is the one which best > represents the range of words known among mature educated native > Englishmen. I dare not venture any opinion whatsoever on the language > of Englishwomen. Not your cup of tea, these females? As usual I include the British in "the Europeans". But my "only used in the US" is NOT about American vs British English here. Perhaps I should have added "in the sense variations of Portugese descent". "Kaukasisch" in its variable spellings across Europe is about a moutainrange, not the name of a supposed race, being, non-american-indian, non-negro, non latin-american, non-asian. [to lump-up all people "from" Asia is also such US-ian nonsense] and probably even non-moslem [meaning non- arab?], but including all non-stark-black Jews and Russians west of the Ural. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web