Online greeting card

Hands-On Project 9-1 from pg 666 in your Vodnik text (6th ed)

In this assignment, you will start work on a web app that enables users to create a greeting card. To accomplish this, you will create code to parse the value of the variable passed from the first web page to the second web page in a query string. You will then add code to display the value in the second web page.

In your text editor, open the index.htm file from the HandsOnProject9-1 folder in the Chapter09 folder, add your name and today’s date where indicated in the comment section, and then save the file.
Before the closing tag, add a script element that references script.js as the source, save your changes, and then close index.htm.
Repeat steps 1 and 2 for the file preview.htm.
Create a new file in your text editor, create a JavaScript comment section containing the text Hands-on Project9-1, your name, today’s date, and the filename script.js, and then save the file with the name script.js to the HandsOnProject9-1 folder.
Add a statement instructing processors to interpret the document contents in strict mode.
Declare a new function named populateInfo(). Within the function, add the following if statement:
Below the populateInfo() function, add the following code to run the function when the page finishes loading:
Save your changes to script.js, and then return to index.htm in your browser.
In the Greeting Text box, type Happy Birthday! and then click the Preview button. The preview.htm page is displayed with the text “Happy Birthday!” formatted as shown:
Figure 9-15: Preview of greeting text in preview.htm page