John Cletheroe's
PC and Internet Hints
|
Web Page Creation Hints and Resources - Checking Your Web Pages
Before uploading your web site masterpiece to the server, it is worth doing some checking. It doesn't matter how many mistakes you make and put right before uploading; it matters a great deal how many mistakes you fail to put right before the public get to see your pages.
Unless you are absolutely familiar with the HTML tags that you are using, then be sure to view your pages on your computer in at least Internet Explorer and Netscape Navigator, as these are by far the most common browsers.
It is fairly simple to write programs in any programming language of your choice (provide it can open and read plain ASCII text files) to perform checks such as the following on all the pages of your site:
- Check that tags which should appear in pairs, such as <H1> and </H1>, are indeed correctly matched. If nothing else, a simple count and comparison of the number of tags in each matching pair would be a very useful check.
- Detect invalid ampersand special characters (the ampersand prefix is used to create special characters such as less than, greater than and accented characters).
- Detect spaces in link text. In order to prevent the text in a link being split across two lines, non-breaking spaces should be used in link text. A program which checks for the presence of any literal spaces in link text would be useful.
- Check that all the internal links in the site are valid. Don't forget to handle links within pages which have the # separator and to ignore external links which start with http://. Also exclude the more exotic external link prefixes such as ftp:// and mailto://.
- Check that no pages are orphaned, in other words that every page has at least one internal link to it.
- Convert the entire site to a single plain text file, with no tags, ready to be imported into a word processor for spell checking purposes.
- Check for redundant <P> and/or <BR> tags next to each other (these don't matter, they are just sloppy).
It is also possible to write similar programs to automatically create site indexes, etc.
One vital aspect of this type of program is to be able to access a list of the web page files to check. Such a list can be created in DOS with a command such as:
DIR *.HTM/S/O:N>DIR.TXT
The /S parameter causes all subdirectories to be explored; /O:N causes the files to be listed in alphabetical order (a nicety) and >DIR.TXT cause the output of the DIR command to be sent to the DIR.TXT file. Then your checking programs can open and read DIR.TXT in order to know what HTML files they need to check.
Web Page Creation Hints and Resources
PC and Internet Hints
About this personal web site JohnCletheroe
EMail me
Most recently modified 25-Mar-01