In this set of exercises, we’ll help
you to spice up your CVP pages by making use of some of JavaScript’s’ built-in
properties and objects. As with the earlier labs in this module, treat these as
independent exercise that should be coded and tested one at a time.
- Start by reviewing the script of your Finder page to see how it makes use of
its arrays, and its document and form objects.
- Use this version of the HTML/JavaScript
interpreter to complete the following exercises.
- Write a statement that displays in text area "tf" the name of the current background color.
- Write a statement that displays in text area "tf" the status (check or not checked) of the checkbox .
- Write a statement that displays in text area "tf" the number of elements on the page .
- Write a statement that displays in text area "tf" the number of options in the select element.
- Write a statement that displays in text area "tf" the currently selected item in the select element.
- Write a statement that displays in text area "tf" the name of the third element in the only form on this page.
- Store as part of the JavaScript code for the Finder page array data describing all of the islands and ratings that you have created and entered on the Summary page table.
- Change the Finder page so that the "Find Island" button takes into account all of the categories listed (Price, Beaches, and Nature).
- Revise functions findBestPrice and findBestBeaches (the latter of which you added to the page in Lab 5.4, exercise 3c) on your Summary page to use JavaScript's "with" statement, so that they need not repeatedly refer to the document's data form.
- Now, return to your Map page. Edit its script so that selecting one of the islands from the selection list (which you added to the page in Lab 5.2, exercise 5f) causes you to go to that island's page.
|
1pp. 126, 127, 139ñ196,
149 2pp. 149, 153ñ158, 210, 270 4pp.
189ñ190,
221
|