Benefits and Best Uses of JavaScript
digitalweb mag's new article on the benefits and best uses of JavaScript:
paul koch describes the 4 views that need to be designed for:
1. plain view (xhtml only)
2. simple presentation view (xhtml + css)
3. simple behavior view (xhtml + js)
4. full view (xhtml + css + js)
There are three general rules for the use of JavaScript in an accessible site.
1. The site should still work when the browser doesn’t support JavaScript, obviously.
2. The script should still work when the browser doesn’t support CSS. A script may not rely on style changes alone to achieve its purpose. Creating a behavior layer without assuming the existence of a presentation layer to back it up can be tricky. I feel we should pay more attention to this problem in the coming year.
3. Styles that hide content and are meant to be overruled by a script, should be set in JavaScript. If you adddisplay: noneto your CSS and rely on JavaScript to toggle it, your site will degrade fast when JavaScript is disabled but CSS is enabled.

Comments