January 9, 2003 2:31 PM PST
W3C releases scripting standard, caveat
In practical terms, the DOM makes it easier to create Web pages with features that are more animated and functional. With scripts, authors can make Web pages process forms, launch pop-up menus and windows, and execute style changes on the fly. Without the DOM, authors would have to code separately for each scripting language to interact with each different browser. The DOM is meant to create a "write once, run everywhere" standard for Web page scripting.
However, W3C staff urged developers to use scripts sparingly, criticizing the development technique as less efficient and accessible than alternative W3C-recommended methods of creating dynamic Web pages.
The trouble with scripts, Jacobs said, is that they are less machine-readable or transparent than so-called declarative languages like SVG and SMIL.
"Scripts tend to do useful things, but in a way that's not obvious for machines to understand," Jacobs said. "I don't imagine a world where you could do everything in a nonscripting way, but it's very hard to know exactly what a script does. From the accessibility perspective, if everything is buried in a scripting language, then it's hard to find an alternative presentation of information. It's hard to repurpose the content."
Others at the W3C echoed Jacobs' attitude toward scripting and the DOM.
"Use the DOM the least you can," said Philippe Le Hégaret, the W3C's DOM activity lead. "If you have an alternative technique to do exactly what you want without using the DOM, then use it. This technology will be more accessible, and it will be easier for someone else to read it."
The DOM has been in progress at the W3C for more than five years. Level 1 came out in 1998, while most of Level 2 came out two years later, in November 2000.
But the part of Level 2 that specified how scripts could interact with HTML content--as opposed to XML, for example, or style sheets--had such serious bugs that it did not receive the W3C's recommendation until Thursday.
The DOM Level 2 is incompatible with Level 1 and consigns it to the recommendation trash heap, the W3C said.
The W3C "strongly suggests that developers and authors conform to DOM Level 2 HTML," the consortium wrote in its release.