The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.


I recently bought this book and I'm trying to run the listing 2.1 code, but I get the following errors:

listing-2.1.html:12 Uncaught ReferenceError: $ is not defined

The first one is due to the fact that the CDN version can't be loaded, since I run this code locally, but, the second one... ?
I think this error is do to the fact that document.write writes the jQuery script after the script in which document.write is located, so, the $ is called before it's declaration. So, there should be another script to contain the jQuery calling. Am I right or am I doing something wrong?