Strategic Web Usability

DOM debabbled

Even though the basics of an HTML web-page have remained pretty consistent since the early days of the public internet, the structure behind that web-page and how it's displayed (or "rendered") by a browser have become increasingly more complex. At the heart of this is something you may have never heard of and yet probably use every day: the DOM.

What's a DOM?
When people started to push the envelope of what a website could do, they naturally wanted to manipulate various elements of web pages through client-side programming (such as Javascript). The problem was that the elements of any page (table cells, fonts, images, etc.) were usually indistinguishable from each other. A font tag is a font tag, etc. To really achieve interactivity, what they needed was a way to address those pieces of the page as individual objects.

Thus, the DOM, or Document Object Model was invented. If you're familiar with object-oriented programming, that may border on self-explanatory. For the rest of us, it's basically two things: (1) a hierarchy of objects, and (2) a naming scheme. The heirarchy is fairly simple, in theory: the document sits on top, tables are higher than rows are higher than cells, etc. The heirarchy creates a sort of naming scheme, but the DOM also extends the ability to name to the web-page designer, allowing almost anything on a web-page to be directly addressable.

What's in it for me?
Put simply, once you can name something, you can tell it what to do. Most of the time, it will even listen, which is handy. The evolution of the DOM allows a much finer level of control via programming, and led the way to the rise of DHTML, which I'll talk about in next week's entry. Unfortunately (and here's where the Geek Factor 4 comes in), the DOM, while very useful, is also incredibly complicated. Add to that the fact that different browsers still use somewhat different DOMs, and high-level manipulation of a web-page can test even the most patient among us. The situation has improved over time and the various DOMs will very likely continue to converge, but be prepared for a steep learning curve.

©2012 User Effect, Inc. · Home · About · Services · Contact · E-book · Blog · Archive