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


Groups > comp.lang.javascript > #29025 > unrolled thread

Re: Element output in JavaScript consoles

Started byRobG <rgqld@iinet.net.au>
First post2015-12-19 16:05 +1000
Last post2015-12-19 16:05 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#29025 — Re: Element output in JavaScript consoles

FromRobG <rgqld@iinet.net.au>
Date2015-12-19 16:05 +1000
SubjectRe: Element output in JavaScript consoles
Message-ID<JISdnRAdLJMHbunLnZ2dnUU7-RmdnZ2d@westnet.com.au>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web