268587 (3) [Avatar] Offline
#1
I can't figure out where to put the loadScript function shown in Listing 2.3. Should it go in the include snippet, or widget.js file, or a new file? Also, there is no indication of if or how it relates to the loadSupportingFiles function shown in Listing 2.2? I read chapters 1-4, then searched through the rest of the book and couldn't find a context for Listing 2.3.

Showing code out of context doesn't serve your goal of teaching Third-Party JavaScript development. The majority of your readers probably know JavaScript already. We use books like yours to see the big picture of development. That picture should provide a context for the smaller bits of code in your book.
268587 (3) [Avatar] Offline
#2
I'm somewhat closer to working out where to put the loadScript function. Page 38 reads:
You’ve given the publisher the script include snippet, which they’ve added to their web page’s HTML source code, and which is causing your application’s initial script file to load on their page. After the script is loaded, it loads any additional supporting JavaScript files.
How does the loadScript function relate to the loadSupportingFiles function in Listing 2.2?