Misa (40) [Avatar] Offline
#1
Some initial comments on the first couple of chapters after a few hours:
- Section 1.3 mentions the "deprecated" module, but I don't see that on GitHub.
- I know you don't seek comments on typos, but there are a lot of places where it looks like a word processor has mangled the text during the correction process. For example, in section 1.3.1: "In fact, while is easy to think that we’ll need all of jQuery in a lot of websites, is really hard that we’ll use all of its functions in the same website.".
- Since this is the third edition, I really think you need to quickly set up new examples for the chapters that are available, which would presumably only take a few minutes. Sending us to the old examples from the second edition which use an older version of jQuery is not good.
- You should make it very clear that the examples in chapter 2 will not work unless deployed on a server! Readers have no way of knowing that, and the book does not mention it. I only found out because readers of the first two editions of this book also faced the same issue, and posted the problem to Manning forums.
- If possible, avoid splitting code samples across pages, as done on the bottom of page 26 and the top of page 27.
- In 2.4 your example to select "all the links but the externals" (p.33) does not work correctly since it lists all the links. I think this is because the expression a[href!='http://'] is selecting all links that are not exactly 'http://', right? However, when I change the expression to a[href^!='http://'] the Selectors Lab Page appears unable to process that selector. So what is the appropriate selector to obtain "all the links but the externals"?

Despite all that I think the book is great so far.
jpalmer1026 (50) [Avatar] Offline
#2
Re: Early feedback
To select all links but the externals you could use:

$("a:not([href^='http://'])");
Misa (40) [Avatar] Offline
#3
Re: Early feedback
Yes, using a:not([href^='http://']) as the selector on the lab page selected all links except the externals. Thanks.

(The book covers the :not filter in section 2.5.5 but I hadn't made it that far.)
AurelioDeRosa (20) [Avatar] Offline
#4
Re: Early feedback
Hi Misa.
Thank you so much for your feedback, it's much appreciate.

About the pagination of the example, keep in mind that what you're reading is not the final version of the chapter. Therefore this kind of issues aren't taken into account.

About this selector, [href^!='http://'], it's not valid, that's why it doesn't work. As suggested, a possible solution is a:not([href^='http://']).
ddavie (4) [Avatar] Offline
#5
Re: Early feedback
Reading page 25 about using a console or debugger to viewing the variable $allElements to see what DOM info was selected. It would be useful to explain how to do this using a console in a browser. I haven't learn't how to yet. I think those type of skills would be useful in learning more about the DOM and debugging and working with jquery.