CS 601 – HTML Validator Firefox Plugin

While Googling for the W3C HTML validator page to add it as a bookmark, I found that there is a plugin for Firefox that will validate the code right in the browser. It has the option to run the same backend validator engine as the service at W3C (the SGML parser), to run a more thorough validation engine (the Tidy parser; also developed by the W3C) or to run them serially (i.e., the W3C engine and then the more thorough one if no errors are found.) The Tidy parser can also do accessibility checks and suggest fixes, among other things. The plugin can be found at https://addons.mozilla.org/en-US/firefox/addon/html-validator/. Keep in mind that you will get more errors with the Tidy parser. Playing with some “real” sites is interesting. Google yields 60 errors. Amazon came up with either 160 or 1566 depending on how the results are read. (I think it’s different reading a frame vs the entire page.) Reddit has 45. It looks like it might have some issues with HTML5, but you simply have to “view source” in the plugin menu. It also has a direct link to the online HTML validator (sending the page) as well as the CSS validator.

CS 601 – Tip for long divs

While working on this weeks homework, I had a couple of times when I lost track of which ending div tag went with the starting tag. I started adding it and commenting it as soon as I write it:

<div id="content">
</div> <!-- END content -->

I then add the content in between. This way, as the content gets very long, I still know which </div> goes with which <div>. In fact, I have also starting do this for other elements that might be long (tables, lists) in html and for code blocks in PHP.

CS 601 – Fragment Linking

Just a short post today. While reading through chapter 3 of the Felke-Morris book, I actually learned something new. While most of the chapter covered basic anchor items, it turns out that the name attribute for fragment linking has been deprecated. Instead the mechanism is to use <div id="foo"> (or any (block only?) element) and the reference it using <a href="#foo"> (as before). This is interesting considering the fact that name is still being used in the BU WordPress 3.1 installation. I’ll have to keep this in mind when writing new pages.