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


Groups > comp.lang.javascript > #29025

Re: Element output in JavaScript consoles

Subject Re: Element output in JavaScript consoles
Newsgroups comp.lang.javascript
References <consoles-20151214163101@ram.dialup.fu-berlin.de>
From RobG <rgqld@iinet.net.au>
Date 2015-12-19 16:05 +1000
Message-ID <JISdnRAdLJMHbunLnZ2dnUU7-RmdnZ2d@westnet.com.au> (permalink)

Show all headers | View raw


On 15/12/2015 01:53, Stefan Ram wrote:
>    I was looking for some DOM applications as examples for my
>    JavaScript course and came up with this use of the Firefox
>    console (input/output pairs):
>
> document.firstElementChild
> <html>

[...]

>
>    I see that the Firefox console kinda »pretty prints« the
>    element. I.e., it does not just say
>
> [object]
>
>    but
>
> <html>
>
>    . I like this! But can I rely on it?

As in "do other browsers do it the same way", then no. Nor is it 
standardised. Even Firefox may change its behaviour any time the 
developers want (i.e. it is implementation dependent).


>    Is this output experimental or is it an established feature?

It is an established feature in reasonably modern browsers.


>    Can it be expected to remain this way in the future?

No, see above.


>    Do other browser consoles behave similar?

"Similar" in that they tend to print something more useful than 
"object", but not consistently the same format and certainly not content.


-- 
Rob

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


Thread

Re: Element output in JavaScript consoles RobG <rgqld@iinet.net.au> - 2015-12-19 16:05 +1000

csiph-web