515262 (6) [Avatar] Offline
#1
Listing 2.8 is labeled:
"Add script with Node.js global in the browser context (app/index.htm)"

But...
I don't know what this means. Do I add a second <script> line that includes something from node.js? If so, what form does it take? Do I add a global variable of some kind? If so, what?

I added the script to index.html as-is from the listing (assuming it goes in <head> ), but it doesn't work.

I haven't used JavaScript since about 2003, which may be obvious from the questions I'm asking.

Looking to find which way is up, please. I just started working my way through the book and now I'm stuck.
515262 (6) [Avatar] Offline
#2
I figured it out.

Scripts can't go in the head, they have to be within <body> tags. Also, they have to come just before the body tag closes.

I'd like to suggest that these gotchas be covered either in context or somewhere in the "What Do I Need to Know?" section in chapter one.

In general, though, a great book so far (overlooking typos which I assume will be dealt with after the final push to finish the first draft).