Will the sadness never end? Back in the glorious days of 1999, Microsoft in their
infinite wisdom invented DHTM Behaviors. Which are actually a fairly cool idea, basically you can bind
JavaScript functions to HTML elements via a CSS property.
I know about them because at the last job where the front end guys built a fairly complex
application using them. I wrote the backend and never touched them. They were
Microsoft only too. It never made it very far at the W3C.
Luckily someone has used XBL to port Microsoft's proprietary CSS extension to Firefox. W00t. Sadly though, it works *better* in Firefox than in IE 6. Microsoft in their infinite wisdom seem to only support a single Script object per Behavior file, while Firefox happily parsed and loaded all my script objects and did what I wanted.
Today I discovered the work around for IE. Enter JSAN. (Cue the Heralding Trupets). JSAN imports my javascript and loads it without my having to have several script sections. I simply make sure that JSAN is loaded at the page level then JSAN.use() whatever I need inside the Behaviors. This means that I can build nice clean modular DHTML behaviors that can be applied and controlled the same way CSS is applied and controlled.