Validating
I’ve started validating all my webpages so I can put them in a portfoiio without cause for embarrassment. It’s fun! Seeing validator.w3.org turn from red to green is exhilarating, especially when lots of errors go away with very small adjustments. The angry “72 errors” I had on the FAQ on House Between the Worlds turned out to be one <h2>something</h3>, two <p>…</li> and a spurious </a>.
Many of the errors the validator finds are in forms and scripts that I didn’t make: the statcounter script has a target="_blank" that’s never used because the counter is invisible, and anyway I wouldn’t want to use it even if the counter wasn’t invisible because I don’t approve of it (here’s a good explanation why). The mail forms I use are horrible, because no value is in quotes and I have to do that all by hand. On the to-do list: learn to make my own mail forms. Oh, and any page with an embedded map needs to be Transitional, not Strict, because
even if there is a way to edit the map script to validate as Strict it’s probably too much work.
WTF moment: The detected DOCTYPE Declaration "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">" has been suppressed and the DOCTYPE for "HTML 4.01 Strict" inserted instead, but even if no errors are shown below the document will not be Valid until you update it to reflect this new
DOCTYPE. So, I did X instead of X, and the validator doesn’t like that and wants me to do X instead? On second thoughts I know what caused this: I’d validated the map page as Transitional to see if that would work (and it did), and then set the validator back to Strict instead of autodetect. Of course it registered that I’d changed it, but not what I’d changed it from or to.
I’m learning a lot from validating. That <form> … </form> isn’t a containing element in itself but needs <p> or <div> or <table> inside it; that you can’t have headings inside a list (well, I already kind of knew that but I’d been getting away with it); and, perhaps most importantly, the confidence that I already write nice neat HTML without making glaring mistakes other than typos and cut-and-paste glitches.
And all my CSS validates on the first try. Woohoo! But I don’t dare try the blog…
Posted: 21-Aug-2010 | /wireless_life/web | link | 0 comments



