Clagnut

Menu

Recent mark-up chatter

I’ve contributed my two penn’orth to a couple of interesting HTML related posts. Dan posed another SimpleQuiz asking how best to mark up a numbered list of title + description pairs. I proposed a number of solutions depending on context and writing style (varying from ordered lists to definition lists with headings or strong elements). The response was vast, so as a taster it’s well worth reading Tantek’s organized analysis of the answers.

Cameron asked whether frames had a place nowadays. The response was mostly ‘no’, with folks rightly citing printing and bookmarking problems. However when these issues are not important, I maintain that frames still have an important role to play.

At A List Apart, Aaron Gustafson gives us an tutorial on using the DOM for advanced show/hide functionality. The tutorial does a fine job of keeping behaviour as a separate layer – there are no event handlers in the HTML source at all – thus the page would still be usable for browsers without scripting enabled. The separation is achieved by using JavaScript to rewrite ordinary hrefs as javascript: protocol function calls.

Slightly bizarrely, the tutorial works the technology into navigating a long article. Ryan Singer pointed out on Signals vs Noise that hiding all of an article except the bit you’re reading is not exactly a good idea, particularly as one does not have a clear idea of length or position within the article. However it is not a stretch of the imagination to see the same technique used for creating a DOM-driven tabset.

Update: Further to Mark’s comment, it is well worth reading Peter Paul Koch’s analysis of Aaron’s, and other ALA JavaScript articles. In particular PPK points out that rewriting hrefs as javascript: is pretty hacky compared with using a lightweight onclick handler. PPK also directs our attention to Simon Willison’s Enhancing Structural Markup with JavaScript tutorial which covers pretty much the same ground as Aaron’s.