Validation

Description

Last week we briefly discussed the importance of good code, and we looked at the validation results of a Web site. In general, it is a good idea to validate a page several times as you develop it (just like how you should save frequently!). This way you can catch errors before they build up and become a mess.

When you turn in your journal this week, I will be checking to see if every page validates. Validation is one of the requirements to get a grade of 4. In the activity below, you will practice using the validator and fixing problems so that you can be successful in validating your own Web pages.

Validation Assignment

  1. Save this Web page to your "web" folder so that you can upload it and your changes to the validator.
  2. Go to http://validator.w3.org and click on the "Validate by File Upload" tab.
  3. You should be here
  4. Browse for the file and upload it. Then scroll down and notice that there are lots of errors.
  5. First set of errors
  6. It is usually best to fix one error at a time, starting at the top error. This is because sometimes an error at the top creates more errors below.
  7. The first error is about the XMLNS attribute. Lucky you! When you set up your template, this attribute was there. Go find the attribute in your template and fix the html tag in this file.
  8. Save the file. Click "revalidate" on the validator. This error should have disappeared.
  9. Second set of errors
  10. The next error says that there is a problem with one of the meta tags. Read the error and attempt to fix the problem on your own. If you are having trouble, ask the teacher for help.
  11. Save the file. Click "revalidate" on the validator. If it did not fix the error, try again or ask for help.
  12. Third set of errors
  13. Look at the next error. It seems there is a problem with the heading. Look carefully at the line and the error message. Attempt to fix the problem. If you are having trouble, ask the teacher for help.
  14. Save the file. Click "revalidate" on the validator. If it did not fix the error, try again or ask for help.
  15. If it did work, notice how the rest of your errors disappeared! This is because if you leave a tag open when you shouldn't, it tends to create problems for the tags that follow it.
  16. All errors are fixed
  17. There are still two warnings. If you want the level 5 grade, fix them.
  18. In the future, I will expect all pages of your projects to validate with no errors. Part of the level 5 grade will include fixing any warnings.
  19. Submit the fixed file to the shared folder.
  20. This assignment is due tomorrow, Tuesday, August 31.