This is

as days pass by, by Stuart Langridge

. Here I write about many things. In the past I wrote about other things but the past is past. I write code for people to play with, I write about my life on Twitter, and I write here.

On I wrote JavaScript triggers, on the subject of JavaScript and the DOM.

A List Apart has an article by PPK on JavaScript triggers where he explains his way of making JavaScript unobtrusive. He says, with a certain degree of accuracy, that using the class attribute as a hook is somewhat limiting. His approach, however, is to create brand new attributes, and then solve the “but it doesn’t validate!” problem by running your own validator. Paul over at paranoidfish expresses my view better than I could when he says “it also seems that the suggested solution is significantly more complicated and harder to maintain than the setup it was intended to improve upon“.
I’ve used non-standard attributes a few times, and sometimes there’s no way around them. When I do it, though, I’m conscious that it’s a hack, not a good approach. Perhaps in an XHTML world this sort of thing is more reasonable, but this ain’t an XHTML world—IE doesn’t interpret your XHTML as XML, for a start.

-----

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.