Standards activists target scripts

A group of Web developers that goaded browser makers into following standards is setting its sights on scripting.

Paul Festa Staff Writer, CNET News.com
Paul Festa
covers browser development and Web standards.
Paul Festa
3 min read
Web standards gadflies are launching an initiative to make sure Web authors are sticking to their scripts.

The Web Standards Project, or WaSP, on Monday launched the DOM Scripting Task Force, whose goal will be to promote adherence to Web standards like the World Wide Web Consortium's Document Object Model and to establish guidelines in the comparatively unstandardized world of scripting.

"At the moment, JavaScript suffers from outdated, uninformed and inaccessible development methods which preclude it, and therefore Web development in general, from attaining its full potential," reads the task force's JavaScript manifesto. "The WaSP DOM Scripting Task Force proposes to solve this problem by the adoption of unobtrusive DOM scripting, a way of thinking based on modern, standards-compliant, accessible Web development best practices."

The W3C recommends the DOM as a way to let scripts act in discrete parts of Web pages. Scripting languages like JavaScript, Microsoft's JScript and ECMA's ECMAScript (which combines elements of the two) perform actions on Web pages independently, for example opening pop-up windows or flashing prompts to visitors.

A primary offense the task force will target is the one that spurred the creation of WaSP seven years ago: coding to one specific browser, usually Microsoft's market-leading Internet Explorer.

"Just because IE for Windows has 80 percent of the market doesn't mean it will work everywhere," said WaSP founding member Dori Smith, co-author of "JavaScript for the World Wide Web." "I see way too much of that, because I primarily use (Apple Computer's browser) Safari. We've been making this argument for years now. It's more of the same. It's all about education."

In founding the task force, the WaSP described today's Web programming model as a three-legged stool, one leg being structure (XHTML), another presentation (Cascading Style Sheets, or CSS), the last behavior (DOM scripting).

The group identified "obtrusive" DOM scripting as the reason for scripts' bad repuation.

"The purpose of JavaScript is enhancing the usability of Web pages by adding interaction to them," reads the manifesto. "Unfortunately this purpose more often than not was an excuse for programmers to display their technical knowledge by inflicting pop-ups, scrolling status bar messages, animated layers, and other GUI elements of questionable value on unsuspecting end users. Worse, these sites' accessibility efforts were too often limited to saying 'Sorry' to users of the wrong browser."

Scripting has generated renewed interest as Google, in particular, has found success creating highly functional Web-based applications like its Gmail and Google Maps sites. Those sites are created using what recently earned the moniker AJAX, or Asynchronous JavaScript + XML.

Scripting also plays a prominent role outside the browser. Macromedia's Dreamweaver Web-authoring tool, for example, uses scripts within the application. Widgets in Apple Computer's Tiger operating system also use them.

The renaissance in Web scripting has come at a cost to accessibility and adherence to Web standards, advocates warn.

Many pages that rely heavily on scripts do not present their content in a way that blind people and others with disabilities can access them. And Web authors who are intent on using the latest scripting techniques may leave older browsers choking on their code. WaSP wants authors to provide scripts that "gracefully degrade" with older browsers, providing some data and functionality, if not the full effect.

The WaSP task force launched with several posts from founding members. The group intends to compile "best practices" and goad high-profile sites with poor scripting methods to improve.

"People are so in love with the stuff that DOM scripting can do," Smith said. "They aren't saying, 'We need to support these older browsers and be accessible to people with disabilities.' We're saying you can do both. It's not either-or."

In other WaSP news, the group earlier this month said it was working with Microsoft on testing Version 7 of IE. WaSP, which for the first several years of its existence relished its outsider status and razzed Netscape and Microsoft for lapses in their standards adherence, has taken to working more closely with software providers in recent years. It maintains a similarly close relationship with Macromedia, for example, in evaluating the Dreamweaver tool.

"We're telling them up front that we want to work with them and make a better product," Smith said. "We want something everyone's happy with, at the end of it all."