Tiffany B. Brown

A web log about web development and internet culture with frequent detours into other stuff.

Posts in: DOM

DOM and JavaScript image rollover
It’s a simple script — about nine lines of JavaScript total. Just add the imageSwapIn and imageSwapOut functions to onmouseover and onmouseout event handlers in the containing element for your image (usually a link). The first function takes two parameters: the image id — which you set using the id value, or by using the [...] [30 Oct 2006]
Today’s DOM scripting tip
Something I learned after many hours of lamenting “Why in the hell doesn’t this work in IE 6?” When setting a class name for an element, use element.className instead of element.setAttribute(’class’,'nameOfClass’) for compatibility with Internet Explorer 6. The latter should work just fine in Internet Explorer 7. I’d avoid using element.style completely to provide the best separation [...] [26 Oct 2006]
Douglas Crockford on the DOM
Via the Web Standards Project: Three videos by Douglas Crockford giving some theory on the Document Object Model and how different browsers handle it. It’s a dry presentation. Like the Sahara. Like twice-burnt toast. Like wind in the desert. I think this was an in-house video for Yahoo! developers, and in that context, I can [...] [25 Oct 2006]