W3C XHTML 1.0 valid - so what?
I’m sure you’ve seen one of these icons before. These are used to indicate that a certain page uses W3C valid code. There exist smaller or text-only versions. I often click such icons when I come across one, just to find out it’s actually incorrect. I can’t remember ever seeing a W3 valid website using this icon.
Many people fail to answer the simple question of “why W3 valid XHTML?”. Or even better, “why XHTML over HTML?”. Bragging rights, mostly. Of course, no-one takes you seriously with a HTML 4 transitional code, that doesn’t even validate.
Why validation in the first place? Web browsers throughout history have never complained about errors in HTML structure. Rather than that they have tried to fix the errors. This made developers lazy and they didn’t care wether their code was really an actual html code. All programming languages complain about syntax errors and so don’t work when “invalid”. But making browsers work this way would break 90% (if not more) of the internet. A big no no there. So W3 took a different approach - Let’s promote the idea of validity among developers. And this is good. It has gone somewhere in the recent years. The problem, though, is that most people don’t realize why this is so important. Browsers draw my page correctly anyway. Yes they do, but have you tried all of them? Are you sure future browser will handle errors the same way they to nowadays? Do screen readers know how to handle errors? How about Google?
Ok, so we know why valid (X)HTML is good, and we have created a valid page. But do our users care? The only thing they care about is wether the page renders correctly or not for them. They don’t care if it renders correctly for everyone else. We should be caring about that.
One thing that I really find funny is how people try to bypass the validation errors. For example, target attribute is not supported in strict doctypes, therefore a link cannot open in a new window using valid strict (X)HTML. What people do, is they add a target attribute to links using javascript. This way they have made an invalid html code, that looks valid to the validator. This shows how validation itself is irrelevant to people, as long as they can stick a “W3 valid” badge to the page. The effect for regular (non-validator) usage is the same though.
So yeah, I’m all for the “validation passed” badges, they do raise people’s awareness, I guess. But using them on pages that are invalid, to me, is like saying you’re a badger, when you’re actually not.
Now with all the badges… Why don’t I ever see any WAI icons?











Another interesting issue is that in order to be able to do “AJAX” you need a good semantic html code under the hood. It’s impossible to do heavy DOM manipulation without valid code since you can only guess how it will behave. Invalid code also usually means that the html artist did not think about classes and element id’s carefuly which can be another souce of frustration.
This is all good thinking, as the validator itself validates the pages without executing javascript they can workaround some of the issues, but if you use firefox’s web development plugin, you can use it’s “validate offline page” feature to check pages after the javascript has altered them, pretty handy feature imo, especially to validate / check pages returned after POST action which cannot be validated in a normal way.
Sometimes even advertisers or visitor trackers break perfectly good html code, a good example is google analytic itself which suggest inserting their script code between and which ofcourse breaks validation in html 4.1 strict.
HTML validation is not only to ensure that the code works properly on most devices, but also to ensure it will work properly in the future, and it promotes good coding techniques (such as alt text on images), altrough lack of TARGET on anchors is almost unacceptible (for example clicking on screenshots gallery images to open larger images in new window without opening an actual popup window which works unacceptible in browsers with fancy tabbed interfaces)
P.S. you may want to enlarge this comments posting textarea as it is really crammed up.
Hmm, i meant google analytics suggest inserting their code between head and body html tags, apparently this website strips html tags completely instead of escaping the html tag characters.
I just found you a WAI icon:
http://www.w3schools.com/php/default.asp
see at the bottom of the page.
Yeah, I’ve seen it on some other W3 pages as well, but I guess that dosn’t count as they’re the authors of the icon (correct me if I’m wrong?) :)
That’s not W3C website, that’s w3schools website (not the same thing or same people).