Debugging your Web pages

by Joe Gillespie — Sep 1, 2004

Every day, someone posts a plea for help on the WPDF Forum or one of the other mailing lists that I frequent. Their new Web page isn't working in some browser or another and they post the URL for people to check it out.

The first thing that I do, is go to Chris Pederick's very handy Web Developer Toolbar in Mozilla and call-up a W3C validation of the HTML and CSS. Nine times out of ten, the page doesn't validate.

Here are the direct links to the W3C HTML and CSS Validators if you don't want to use the toolbar. JavaScript validation can be done within Mozilla or Firefox with their JavaScript consoles.

Every time I get onto my bank to complain that their online banking page is broken, I get a diatribe read across the phone to me about my browser settings. Blah, blah, blah! Last week I couldn't get the page to work in Explorer or Mozilla. It never did work properly in Explorer but it did work in Mozilla – last week.

I was waiting for the usual helpline 'Just a minute while I check with someone else' when I decided to try the W3C Validator on the bank's pages.

What a mess!

This was HTML from 1998! No DocType, no encoding and a host of other errors. When the W3C Validator doesn't get a DocType, it assumes 4.01 and tries anyway but still the HTML was way too flaky and it just choked. It was the navigation that didn't work but then, if you rely entirely on Java applets for site navigation, disasters are par for the course!

It only takes a few seconds to run a page through the W3C Validator. It will spell out any major problems it encounters and give warnings of minor ones. The syntax checker in your editor is better than nothing but it won't do such a good job. When your page does validate one hundred percent, it's still no guarantee that it will work in every browser, but it's a good starting point. After that, you are dealing with browser bugs and peculiarities – but that's another story. Digg Technorati Blinklist Furl reddit Design Float