Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39163

Re: JavaScript + DOM, type system

Newsgroups comp.lang.javascript
Subject Re: JavaScript + DOM, type system
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <DOM-20201119215052@ram.dialup.fu-berlin.de> <XnsAC7B5164CF3eejj99@194.109.6.166> <e2acf90f-432f-4f3b-a575-f834ffa7b01dn@googlegroups.com> <2K-dneuu4a7SySrCnZ2dnUU7-Q3NnZ2d@westnet.com.au>
Date 2020-11-20 14:46 +0100
Message-ID <XnsAC7B96571F1CBeejj99@194.109.6.166> (permalink)

Show all headers | View raw


Andrew Poulos <ap_prog@hotmail.com> wrote on 20 Nov 2020 in 
comp.lang.javascript:

> On 20/11/2020 1:47 pm, Michael Haufe (TNO) wrote:
>> On Thursday, November 19, 2020 at 5:02:02 PM UTC-6, Evertjan. wrote:
>>> r...@zedat.fu-berlin.de (Stefan Ram) wrote on 19 Nov 2020 in
>>> comp.lang.javascript:
>>>
>>>> When "a" is an element,
>>>>
>>>> a.textContent = 4
>>>>
>>>> seems to behave like
>>>>
>>>> a.textContent = "4"
>>>>
>>>> , but is there any specification giving the meaning of the
>>>> assignment of a number of JavaScript to the textContent
>>>> attribute of the DOM?
>>>
>>> The text-content of a Dom-node must be a string, logic says.
>> 
>> Right, and if that wasn't enough there is MDN:
>> 
>> <https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent>
>> 
>> and the IDL:
>> 
>> <https://www.w3.org/TR/DOM-Level-3-Core/idl-definitions.html>
>> 
>> depending on how formal one wants an answer
> 
> I thought he was asking, why does a number get changed to, the 
> equivalent of, the number + "" and not, I presume, return some sort of 
> error.

Bbbut ...

Everything, that is written as text, must be a formatted string.

It confused me, long time ago, in Algol, why you needed always to specify 
the format of an output to a printing device.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: JavaScript + DOM, type system "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-11-20 00:01 +0100
  Re: JavaScript + DOM, type system "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-11-19 18:47 -0800
    Re: JavaScript + DOM, type system Andrew Poulos <ap_prog@hotmail.com> - 2020-11-20 16:29 +1100
      Re: JavaScript + DOM, type system "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-11-20 14:46 +0100
        Re: JavaScript + DOM, type system JJ <jj4public@gmail.com> - 2020-11-21 14:47 +0700
          Re: JavaScript + DOM, type system Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-11-21 23:27 +0100
            Re: JavaScript + DOM, type system "sc...@sauyet.com" <scott@sauyet.com> - 2020-12-02 11:04 -0800

csiph-web