Lab 5—Your First JavaScripts

Part 1—Compare body and header scripts


  1. In Firefox, click the File menu and select Open File.
  2. Open header.html. Does the alert pop up? What shows on the screen before you click OK?
  3. Repeat Step 1 and open body.html. What shows on the screen before you click OK?
  4. What difference does placement of the script make?

    If your scripts didn't work, use the Firefox Error Console to find your errors and fix them. It works a lot like the Validator. It gives an error message and the line number in your code.

 

In the next page, you will fix some simple errors in a script....
previous page   next page

 

 

Firefox Error Console

  1. In Firefox, Tools > Error Console
  2. Clear
  3. Reload page the long way—highlighting URL and pressing Enter (clicking the refresh button only partly reloads the page)
  4. Check for errors. Find the line and correct the error.