Scripts

Accessibility Standards Checklist

Requirement

Ensure that pages are usable when scripts are turned off or not supported. If this is not possible, provide equivalent information on an alternative accessible page.

Reason

More and more, scripts are better handled through assistive technologies and tools. But, because scripts can be turned off within a browser, it is necessary that you use an alternative method for displaying ideas with scripts.

Examples

At this time, many elements of Dynamic HTML cannot be made directly accessible to assistive technologies and keyboards, especially when the onMouseover command is used. If an onMouseover (or similar) element does not contain any important information (e.g. the script causes a button to "glow"), then there is no consequence for accessibility. If this scripted event reveals important information, then a keyboard-accessible alternative is required.

Script

Content developers must ensure that pages are accessible with scripts turned off or in browsers that don't support scripts.

  • Avoid creating content on the fly for the client. If a user's browser does not handle scripts, no content will be generated or displayed. However, this is different than displaying or hiding already existing content by using a combination of style sheets and scripting. This also does not rule out generating pages on the fly on the server-side and delivering them to the client.
  • Avoid creating links that use "javascript" as the URL. If a user is not using scripts, then they won't be able to link since the browser can't create the link content. If you do use them, insure that you alert the user that they will be opening a new page. For example,
    <a href="javascript:void(0);" onClick="window.open('URL','link','scrollbars=yes,menubar=yes,width=500,height=400,screenx=50');" title="Opens a new page to CNN Web page.">

NoScript

The noscript element allows authors to provide alternate content when a script is not executed.

  • <SCRIPT type="text/javascript">
  • ...some javascript to show a billboard of sports scores...
  • </SCRIPT>
  • <NOSCRIPT>
    • <P>Results from yesterday's games:</P>
    • <P> Bulls 91, Sonics 80. <BR>
    • <A href="bullsonic.html">Bulls vs. Sonics game highlights</A>
    • ...more scores...
  • </NOSCRIPT>

The TRACE Center offers Java and JavaScript accessibility techniques. http://www.trace.wisc.edu/world/java/jscript.htm

Suggestions for testing this on your pages

[Back To List]