Welcome to AssignmentCache!

New Perspectives on HTML XHTML and Dynamic HTML Chapter 14 Case Problem 1 The Monroe Public Library

Availability: In stock

Regular Price: $20.00

Special Price: $15.00

Quick Overview

New Perspectives on HTML, XHTML, and Dynamic HTML Chapter 14 Case Problem 1 The Monroe Public Library


The Monroe Public Library At the Monroe Public Library, Denise Kruschev works on the library’s Web site. One of her responsibilities is to add content to the site that will be of interest to the library’s patrons. Denise’s latest assignment is to create a Web page containing links to hundreds of government Web sites. She knows that a long list of links will fill the page, making the page difficult to use. Instead, Denise wants to use “select and go navigation,” in which the links are placed within a selection list. When a user selects a link from the list, the linked page should open automatically. Denise already set up the selection lists, but she asks you to help write the JavaScript program. Figure 14-67 shows a preview of the Web page.


Complete the following:
1. Use your text editor to open the mpltxt.htm and linkstxt.js files from the tutorial.14/case1 folder, enter your name and the date in the comment section of
each file, and then save the files as mpl.htm and links.js, respectively.
2. Go to the mpl.htm file in your text editor and create a link to the links.js file.
3. Scroll through the mpl.htm file, studying the code. Each option in the selection list contains a value referencing the URL of a government Web site. Close the file, saving your changes.
4. Go to the links.js file in your text editor and insert an event handler to run the init() function when the page is loaded.
5. Create the init() function. Within this function do the following:
a. Create a variable named allSelect that references all of the selection elements in the document.
b. For each item within the allSelect object collection, add an onchange event handler that runs the loadLink() function when the selection list changes.
6. Create the loadLink() function. The purpose of this function is to cause the brows er to load a URL from a selection list. Add the following commands to the function:
a. Create a variable named sIndex that points to the index of the selected option in the current selection list. (Hint: Use the this keyword to reference the current selection list.)
b. Web pages can be loaded using the command location.href = url; where url is the URL of theWeb page. Enter this command into the function using the value of the selected option from the selection list as the value of url. (Hint: Use the sIndex variable to point to the selected option from the current selection list.)
7. Save your changes to the file.
8. Open mpl.htm in your Web browser. Verify that by clicking the links from the selection lists on the page you can bring up the corresponding government Web sites.
9. Submit your completed files to your instructor.

New Perspectives on HTML, XHTML, and Dynamic HTML Chapter 14 Case Problem 1 The Monroe Public Library

Double click on above image to view full picture

Zoom Out
Zoom In

More Views

  • New Perspectives on HTML, XHTML, and Dynamic HTML Chapter 14 Case Problem 1 The Monroe Public Library

Regular Price: $20.00

Special Price: $15.00

Details

New Perspectives on HTML, XHTML, and Dynamic HTML Chapter 14 Case Problem 1 The Monroe Public Library

The Monroe Public Library At the Monroe Public Library, Denise Kruschev works on the library’s Web site. One of her responsibilities is to add content to the site that will be of interest to the library’s patrons. Denise’s latest assignment is to create a Web page containing links to hundreds of government Web sites. She knows that a long list of links will fill the page, making the page difficult to use. Instead, Denise wants to use “select and go navigation,” in which the links are placed within a selection list. When a user selects a link from the list, the linked page should open automatically. Denise already set up the selection lists, but she asks you to help write the JavaScript program. Figure 14-67 shows a preview of the Web page.

Complete the following:
1. Use your text editor to open the mpltxt.htm and linkstxt.js files from the tutorial.14/case1 folder, enter your name and the date in the comment section of
each file, and then save the files as mpl.htm and links.js, respectively.
2. Go to the mpl.htm file in your text editor and create a link to the links.js file.
3. Scroll through the mpl.htm file, studying the code. Each option in the selection list contains a value referencing the URL of a government Web site. Close the file, saving your changes.
4. Go to the links.js file in your text editor and insert an event handler to run the init() function when the page is loaded.
5. Create the init() function. Within this function do the following:
a. Create a variable named allSelect that references all of the selection elements in the document.
b. For each item within the allSelect object collection, add an onchange event handler that runs the loadLink() function when the selection list changes.
6. Create the loadLink() function. The purpose of this function is to cause the brows er to load a URL from a selection list. Add the following commands to the function:
a. Create a variable named sIndex that points to the index of the selected option in the current selection list. (Hint: Use the this keyword to reference the current selection list.)
b. Web pages can be loaded using the command location.href = url; where url is the URL of theWeb page. Enter this command into the function using the value of the selected option from the selection list as the value of url. (Hint: Use the sIndex variable to point to the selected option from the current selection list.)
7. Save your changes to the file.
8. Open mpl.htm in your Web browser. Verify that by clicking the links from the selection lists on the page you can bring up the corresponding government Web sites.
9. Submit your completed files to your instructor.

Product Tags

Use spaces to separate tags. Use single quotes (') for phrases.