Reading
JavaScript Text, Chapter 2, pgs 76-99 (Expressions, Operators, Strings, and Precedence)
Discussion
- Operators
- Prefix and Postfix operators
- Not all browsers recognize all prefix and postfix operators. Use caution when using these operators.
Practice:
- Displaying Variables
- Create an assignment4 folder (no spaces in the name, no uppercase) in your public_html folder.
- NBAStatLeaders page
- Open your template in LTS. Save as NBAStatLeaders.htm in the assignment4 folder.
- Click on NBAStatLeaders.html.
- Right click on the page.
- View Source
- Copy the code between the body tags.
- Paste the code into your new NBAStatLeaders.htm page below the comment <--Your XHTML here -->
- Change href value in the link tag to js_styles.css.
- Add the coding from step 7 on page 83 of the text.
There are typos from the author that you can ignore. The author used subscripts:
[1] for two point baskets instead of [2]
[2] for free throws instead of [3]
[3] for number of games instead of [1]
Be very careful when entering the code. The book shows the strings broken because
of word wrap. You cannot break a string using word wrap. Ways to correct:
- Create a very long line and keep the string on the same line
- Break the line at the + operator and go to the next line before
you start a string you cannot complete easily.
- Close the string, go to the next line, add a + operator, open a new string.
Make sure to allow for a blank between two words.
- Save the document.
- Compare your page to Figure 2-15 on page 84 of the text.
- Comparison and Conditional Operators
- NBAStatLeaders page revisited
- Strings
- Update NBAStatLeaders2.htm
- If necessary, open NBAStatLeaders2.htm in your editor.
- Save as NBAStatLeaders3.htm in your assignment4 folder.
- Make the changes noted on pages 93 and 94 of your text.
- Operator Precedence
- Update NBAStatLeaders3.htm
- Open NBAStatLeaders3.htm in your editor.
- Save as NBAStatLeaders.htm in your assignment4 folder (notice no number in the name.
- Make the changes noted on pages 98 and 99 of your text.

Case Project:
- Complete Case Project 2-1 found on pages 112 of your text.
- Open your template.htm page.
- Save as BMI.htm in your assignment4 folder.
- Follow the steps described in the text but start with the template so that you will
have the validation icons on your page.
- Add a heading for the page: Body Mass Index
- Use CSS to center the entire report horizontally. (Do not center the validation images.)
for a reminder on centering, refer back to centering assignment 3.

Update your index page
- Add links on your index page to the pages in your assignment4 folder that are to be graded:
- NBAStatLeaders.htm
- BMI.htm
Uploading
- Upload your revised index.htm page to the public_html folder.
- Upload your assignment4 folder with the files:
- NBAStatLeaders.htm
- BMI.htm
Testing uploaded pages
- Follow the checklist for grading shown on
the schedule page.
- Make any corrections for any page that does not validate or display correctly.