Errata

DOM Enlightenment

Errata for DOM Enlightenment

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
ePub Page 1
Canada

I suggest that this

"The browser, when loading the HTML document, interrupts and parses this hierarchy . . ."

should probably be

"The browser, when loading the HTML document, interprets and parses this hierarchy . . ."

Roger Tessier  Mar 06, 2013 
PDF Page 8
2nd last paragraph

The book says that the third parameter for addEventListener can be set to "true or unspecified for bubbling, or false for capturing."

According to MDN [https://developer.mozilla.org/en-US/docs/DOM/element.addEventListener] and the W3C [http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces], the third parameter is set to true for capturing and false or unspecified for bubbling.

Anonymous  Mar 25, 2013 
Printed Page 12
code example - second variable

The book says:
var textNode = document.createTextNode('Hi');
console.log(textNode, textNode.nodeType); /* logs Text {} 3, and 3 indicates a text node */

In fact, the console logs:
"Hi" 3


Anonymous  Apr 09, 2016 
ePub Page 14
begining of page

console log
<span id="C">dude</span>
should be
<div id="C">dude</div>

Anto Jurkovic  Apr 05, 2013 
PDF Page 14

end of page, console log shows:
<i id="A">

It should be
<i id="elm">

Anto Jurkovic  Apr 05, 2013 
Printed, Other Digital Version Page 17
First sentence

The below comment should be "create a strong element node" instead of "blink"

//create a blink element node and text node
var elementNode = document.createElement('strong');

Elijah Lynn  Feb 20, 2015 
PDF Page 18
end of page

divB variable name is little misleading: it is actualy text 'Dude' in divB. So, divB.parentNode is not body but "div id=B"

Anto Jurkovic  Apr 05, 2013 
ePub Page 21


DOM Enlightenment, p. 21, wrong console log

console.log(document.getElementById('A').outerHTML); /* logs <div id="A">Hi</div>

should be

console.log(document.getElementById('A').outerHTML); /* logs <div id="A"><i>Hi</i></div>

Anonymous  Mar 15, 2013 
PDF Page 25
Unordered List

3rd and 4th items in the list should not be:

? nextElementChild
? previousElementChild

but instead:

? nextElementSibling
? previousElementSibling

Ore Landau  Mar 12, 2013 
PDF Page 26
1st code block, 3rd to last comment

console.log(ul.children); //HTMLCollection, all child nodes including text nodes

This is wrong. 'children' doesn't include text nodes, only elements.

Can be verified here: http://www.w3.org/TR/dom/#dom-element-children

Ore Landau  Mar 12, 2013 
PDF Page 27
Notes

contains() will return true if the node selected and the node passed
in are identical.

This is wrong. A technically correct sentence would be:

contains() will return true if the node selected contains thenode passed in.

But this is almost a duplicate of the first paragraph of the chapter, so it might possibly be omitted

Ore Landau  Mar 12, 2013 
Printed Page 32
code block, third comment

// documment inherited properties only

should be:

// document inherited properties only

Luca Leone  Dec 31, 2018 
PDF Page 39
2nd paragraph from last

section 2.10, the code listing:

ownerElement(boled)
should be:
ownerDocument

sandbox wang  Oct 26, 2015 
PDF Page 42-43
Code example for listing 3.2

The code example for listing 3.2 is supposed to log to the console only own, both own and inherited, and only inherited properties of an HTML*Element Object, specifically an anchor element.

However, the second and third log statements are logging the document object 's properties and not the anchor object's properties. In fact, most of the code in this example is identical to the code example found in listing 2.2, which similarly lists own/inherited properties of the document object.

Should the for/in loops in listing 3.2 be looping through the anchor object as opposed to the document object?

Anonymous  Mar 22, 2013 
PDF Page 54
2nd paragraph within the Notes

The last word of the paragraph should be spelled 'querying'.

Anonymous  Mar 26, 2013 
Other Digital Version 85
http://jsfiddle.net/domenlightenment/9FEzq/

The live code doesn't work because of a typo (note a 'g' character in the word "Selector"):
querySelecgtor

Dmitry Kuzminov  Sep 11, 2017 
PDF Page 107
7th line, 11th line

In the 7th line, should be:
var styleSheetRule=document.querySelector("#styleElement").sheet.cssRules[0];
or
var styleSheetRule=document.querySelector("#styleElement").sheet.rules[0];

in the 11th line, the variable name should be "styleSheetRulePropertiesIncludeInherited".

sandbox wang  Nov 14, 2015