Saturday, July 10
XHTML validation + JavaScript = Driving me *nuts!*
As small as a template as my
linkblog is, I was able to get it to XHTML 1.0 Transitional verify fairly easy. I went through hell getting my automation to finally encode & in my hrefs (I wasn't even sure that they would work, but they do), and I've got that working correctly now. And everytime I jab the little button, it keeps saying that it's valid. Maybe I should set up that RSS for validation that I saw earlier this week (and didn't blog or linkblog, I thought it was a little ridiculous).
Any ways, I decided to see what I could do with this blog, which was originally valid when I started with it, strict even. After working with the linkblog, I went through all the hrefs, and all the srcs, and got them under control. I then fixed all my <P /> stuff (it needs to be lower case), and then I fixed all my HTML to be lowercase. I also fixed a few images that I hadn't put a ' /' before the closing of the img tag. I'm just under 400 errors at this point, and I'm not sure what the hell I can do to "fix" it. The trouble is, I'm using JavaScript to alternate dark and light boxes in my blog. The validator sees both the script and the noscript div that I do, and complains about it horribly.
Two things come to mind. Comment out the noscript for now, and fix everything else.
Or rewrite the javascript into PHP, since I'm now running it under PHP. THEN the validator will only see the PHP generated code, and I don't have to worry about javascript, which is problematic with the damn validator anyway. It tries to validate javascript code, which is a problem. Surrounding the scrip with comments is supposed to stop it, but it only works if I put the start comment on one line, then the code on the next line, then the end comment on another line.
Note: The Validator XML support has some limitations.
Yeah, no doubt that it does, and some big limitations at that.
I guess rewriting it into PHP might be the ticket, then I don't have to worry about whether or not somebody is running JavaScript, I won't care.
OK, I'll look at all the javascript and see what I can rewrite into PHP. Leave the JavaScript for historical reasons. Ha!
Permanent link posted by bytehead @ 7/10/2004 10:26:00 PM
0 comments
0 Comments:
Post a Comment
Links to this post: