Matt Jones

before you play two notes learn how to play one note - and don't play one note unless you've got a reason to play it - Mark Hollis

The Wrong Way to Divide a Cake

This week’s issue of A List Apart has an article entitled Let them eat cake which explains how to break down long articles into easier to digest chunks using Javascript and the DOM. While it may be well coded, backwards compatible with Javascript disabled browsers and have some use for certain applications, I don’t think it’s an approach – especially as demonstrated in the final example – that should be encouraged, and I certainly take issue with the claim that it makes the content more accessible and useable.

It seems to be using Javascript to replicate the basic function of the browser; to request a page of information when a link is clicked. In my opinion, this creates more problems than it solves; spoofing separate pages within a single HTML document breaks the back button, and each chunk of content lacks its own URI meaning that it can’t easily be referenced.

There’s already a standard mechanism in place for breaking a long HTML page down into separate chunks: the internal anchor. These allow for sections of a page to be individually referenced and stored as a visited link, as well as keeping the back button working as it should.

I hate to read like Mr Nielsen here, but unless I’m missing an obvious problem that this method solves, I think this is re-inventing the wheel, badly. I’m surprised at ALA publishing this.

2 Responses to “The Wrong Way to Divide a Cake”

  1. Stu Says:

    Not looked at this in detail yet, but looking at that demo page I fear you\’re correct. Last week\’s article on font sizing also seemed to be recreating functionality that belongs in the user agent, not the web page. I think it takes more than a little JavaScript trickery, however elegantly coded, to make a site accessible *and* usable.

  2. Matt Says:

    I feel slightly bad about about criticising ALA as it\’s such a great resource. I guess you take what you need from it, and this article will be of use to some developers.

Leave a Reply