Clagnut

Menu

Structure, presentation & behaviour

§ Web standards · Accessibility

By the miracle of coincidence, the latest issue of Digital Web has a fine article describing the issues I tried to overcome with the Clagnut drop-down menu, as discussed in my previous post.

Peter-Paul Koch’s article described how the structural layer (XHTML) is a constant and, to remain fully accessible, a Web site should still work with & without any combination of presentation layer (CSS) and/or behaviour layer (JavaScript). The result being these three rules:

  1. The site should still work when the browser doesn’t support JavaScript.
  2. The script should still work when the browser doesn’t support CSS.
  3. Styles that hide content and are meant to be overruled by a script, should be set in JavaScript.

It’s worth noting that in order to more completely separate the structure and behaviour layers in Clagnut, I’ve removed the onclick event handler from the XHTML, replacing it with its DOM equivalent in the JavaScript:

document.getElementById('ddBut').onclick =
function() {
  return showhide('toc');
}