Learning jQuery, 3rd Edition

Home Code Browser

Errata

Chapter 1

no errata yet

Chapter 2

no errata yet

Chapter 3

no errata yet

Chapter 4

no errata yet

Chapter 5

Listing 5.16

The listing omits the the "footnote-n" ID for the appended link.

It reads:

$(document).ready(function() { var $notes = $('<ol id="notes"></ol>').insertBefore('#footer'); $('span.footnote').each(function(index) { $(this) .before(['<a href="#footnote-', index + 1, '" id="context-', index + 1, '" class="context">', '<sup>', index + 1, '</sup></a>'].join('')) .append([ '&nbsp;(<a href="#context-', index + 1, // omitted line
"
'>context</a>)' ].join('')) .appendTo($notes) .wrap('<li></li>'); }); });

It should read:

$(document).ready(function() { var $notes = $('<ol id="notes"></ol>').insertBefore('#footer'); $('span.footnote').each(function(index) { $(this) .before(['<a href="#footnote-', index + 1, '" id="context-', index + 1, '" class="context">', '<sup>', index + 1, '</sup></a>'].join('')) .append([ '&nbsp;(<a href="#context-', index + 1, '" id="footnote-', index +1 , '">context</a>)' ].join('')) .appendTo($notes) .wrap('<li></li>'); }); });

Chapter 6

Page 179, question #4 refers to a Twitter URL that is no longer available.

It reads:

4. Challenge: When the page loads, send a JSONP request to Twitter and retrieve a user's last five messages. Insert the messages into the content area of the page. The URL to retrieve the last five messages of user kswedberg is: http://twitter.com/status/user_timeline/kswedberg.json?count=5.

To complete the challenge question, follow these instructions instead:

4. Challenge: When the page loads, send a JSONP request to GitHub and retrieve a list of repositories for a user. Insert the name and URL of each repo into the content area of the page. The URL to retrieve the jQuery project's repos is: https://api.github.com/users/jquery/repos

Chapter 7

no errata yet

Chapter 8

Page 221, paragraph 3 has an incorrect code snippet.

It reads:

.tooltip({offsetX: -10, offsetX: 25}).

It should read:

.tooltip({offsetX: -10, offsetY: 25}).

Chapter 9

no errata yet

Chapter 10

no errata yet

Chapter 11

no errata yet

Chapter 12

no errata yet

Chapter 13

The JSONP search API for the jQuery documentation is currently unavailable at the URL provided in the book. Until it is back up and running, change:

http://api.jquery.com/jsonp/

to:

http://book.learningjquery.com/api/