This page contains the errata in "ppk on JavaScript".
Back to the Book homepage.
<link>
elements but to hyperlinks.MSIE 5
" should be "contains MSIE
". The code
doesn't check for the '5'.alert(exampleString.lastIndexOf('a',18))
var tg = [target of event]
should bevar evtTarget = [target of event]
function stopProp (e) { var evt = e || window.event; if (evt.stopPropagation) evt.stopPropagation(); evt.cancelBubble = true; }
myHappniess
" should be "object thingsToHave
".cancelBubble = true
only works in the Microsoft event model, but it
turns out to work in all browsers. A retest is obviously necessary.e.type
should be evt.type
.nodeName
. Right now the example doesn't fit the surrounding text too well.relatedItem
property to point to this <li>
." Should
be <ul>
instead of <li>
.insertBefore(x,x.previousElement)
should read
insertBefore(x,previousElement)
(without the x.
)if
statement, but it isn't. After that, a line is missing. Should read
like this:if (!hiddenFormFieldsPointers[rel]) hiddenFormFieldsPointers[rel] = new Array(); var relIndex = hiddenFormFieldsPointers[rel].length; // incorrectly indented hiddenFormFieldsPointers[rel][relIndex] = hiddenFields[0]; // this line is missing var newMarker = marker.cloneNode(true); etc.
replace(/ errorMessage/,'')
, but the all-important space between the "/" and the "e" is not very clear because it's at the end of a line.