HTML and CSS Reference
In-Depth Information
Make It Right
Analyze the JavaScript code on a Web page and correct all errors.
Correcting Syntax Errors and Inserting Missing Code
Instructions: Start your browser. Open the file makeitright9-1.html from the Chapter09\MakeItRight
folder of the Data Files for Students. See the inside back cover of this topic for instructions for
downloading the Data Files for Students, or see your instructor for information on accessing the files
required in this topic.
The Web page shown in Figure 9-21 is an announcement for a Memorial Day sale at Frank's
Fix-it Hardware. This Web page has four errors that you are to find and correct.
Perform the following tasks:
1. When you open the make9-1.html file in the browser, you will notice that the scroll bar did not
change color, the dynamic message did not display between the horizontal lines, and the copyright
and date last modified did not display. After you find and fix the error that will display the dynamic
message, the date will include the time. You must remove the time from the message and only
display the date.
2. Start Notepad++. Open the make9-1.html file. Save the HTML file in the Chapter09\
MakeItRight folder using the filename make9-1solution.html.
3. Compare the code in the user-defined function to the code to change the scroll bar color in
Table 9-21 on page HTML 429. Make the changes necessary to change the scroll bar color in
the Frank's Fix-it Hardware Web page.
4. Compare the code for creating a dynamic message in Tables 9-15, 9-17, and 9-19 on pages HTML
422, 425, and 427, to the code in the HTML file for the Frank's Fix-it Hardware Web page, and
make corrections as necessary.
5. Make sure the user-defined functions are called properly by the correct event handlers and that
they are in the correct locations.
6. Save the corrected HTML file and test it using your browser. If errors occur, check your code and
save again. Your Web page should look similar to Figure 9-21.
7. Submit the revised HTML file and Web page in the format specified by your instructor.
Search WWH ::

Custom Search