JavaScript EditorBest javascript editor debugger     Ajax website 

Main Page

Previous Page
Next Page

Testing Your Page

Even if your code validates, your page still may not work the way you want it to. Or it may work properly in one browser, but not in the next. It's important to test your page in as many browsers as possible, on as many platforms as possible. At the very least, test your page on current versions of both Explorer and Netscape on both Windows and Macintosh.

To test your (X)HTML pages:

Validate your (X)HTML and CSS (see page 345). Make any necessary changes.

Open a browser, and choose File > Open File.

Find the Web page on your hard disk that you want to test and click Open. The page appears in the browser.

Go through the whole page and make sure it looks exactly the way you want it. For example:

  • Is the formatting like you wanted?

  • Does each of your URLs point to the proper document? (You can check the URLs by clicking them if the destination files are located in the same relative position on the local computer.)

  • Is your CSS file referenced properly?

  • Do all of your images appear? Are they placed and aligned properly?

  • Have you included your name and email address so that your users can contact you with comments and suggestions? (Or, to avoid spambots, have you included a form that people can use to submit comments?)

Figure 22.16. This page validates but it doesn't look anything like it's supposed to. What's the problem?

Figure 22.17. The problem is the link to the CSS filethe file is named testpage.css and here I'm linking to testerpage.css. It should be no surprise that the browser can't find the CSS and thus displays the page wrong.

Without closing the page in the browser, open the appropriate (X)HTML or CSS document and make any necessary changes.

Save the changes.

Switch back to the browser and press Refresh or Reload to see the changes.

Repeat steps 17 until you are satisfied with your Web page. Don't get discouraged if it takes several tries.

Revalidate the code to make sure you haven't introduced any new errors.

Upload the files to the server (see page 353).

Return to the browser and type your page's URL in the Address bar and hit Return. The page will appear in the browser.

With your page on the server, go through your page again to make sure everything is all right.

Figure 22.18. Now that the link to the CSS is corrected, the page is displayed properly.


  • Again, if you can, test your (X)HTML documents in several browsers on various platforms. You never know what browser (or computer) your visitors will use. The major browsers are discussed on pages 1516.

  • The rest of this chapter deals with common problems that can occur in validated code as well as their solutions.

  • Sometimes it's not your faultespecially with styles. Make sure a browser supports the feature you're having trouble with before assuming the problem is with your code.

Previous Page
Next Page

JavaScript EditorBest javascript editor debugger     Ajax website