In nanoblogger there is a really nice option to run
HTML Tidy every time you add an entry. It's purpose is to
go through your code, check for obvious errors and hopefully correct them. One
of the things that
nanoblogger does is put the XHTML Validated icon in if you
want to show others that you are standards compliant. Well, while messing
around I decided to actually click my own XHTML Validated icon and see what
happened. Much to my surprise I wasn't even close to being valid. The
validator found something on the order of 50 errors just on the front page! My
first though was, "WTF? I'm running tidy! It should be OK."
My first reaction was to let the guys on the nanoblogger mailing list know that
I was having a problem. That was my first mistake. I committed the sin of not
investigating farther into the situation before I opened my big mouth. After a
couple of posts I realized that the problem was indeed mine and no one elses.
So, off I went to edit my page and see what I did wrong.
Now, there were plenty of errors on my part. Things like uppercase tags,
ampersands that weren't encoded properly, missing end tags for things like
images, and no alt attribute for the images either. However, as anyone can
see, I've added things that are not part of the standard nanoblogger. In
particular, I've added stuff from Amazon, Bloglines, and the Creative Commons
License among a couple of other things. What I noticed is maybe about 75% of
the errors I found were in code that either I didn't write or was never a part
of nanoblogger in the first place. Amazon by far was the worst. When you get
the code from them for their search box, or to put the images of books and
things that I blog about from time to time, you just copy and paste it. I'm
not talking just copying and pasting the address from the address bar on your
browser. They actually have a page that generates the URL for you and put it
in a text box for you to copy. You'd
think that they would take the time to make it correct. But, apparently they do
not. So, lesson learned, don't assume it's write. Take a few minutes and look
it over.
As an interesting aside, I noticed that some of the tags were IE
specific, thus not to the standard. I'm not sure why these tags are even there
in the first place
because when I took them out everything looked the same in both Firefox and IE.
So, I went on through all of the archives and ran the validator on them just to
see what was what and, of course, found a slew of errors. Now, I know I could
have just left all this go, but I mainly did it as a learning exercise. Also,
I figure if I'm going to display those nice little graphics saying how
wonderfully standards compliant I am then I probably should be.
So, anyway, lesson learned are:
- Don't blindly trust code you didn't write. At least look it over
before you use it
- Don't point the finger at the tool, when it's the user (being me
this time) who doesn't know how to use the tool correctly
- Investigate the problem before barking for help. It help you not
look like an ass and you may just learn something in the process.
You'd think I'd know this all by now?