universal-design-center

  • scripting

Web Accessibility Criteria - Scripting

  Description 

Scripting is a programming method that is used to trigger an event or populate content within the client's browser (client-side scripting) in addition to the client- or server-side data and content processing. For example, JavaScript is processed when the webpage is loaded or through an event triggered response. JavaScript allows the webpage designers to add content for user interaction and information processing.  Server-side scripting helps validate form elements before a form is displayed.

When it comes to accessibility, it is important that when scripting language is used, it must be developed in such a manner that will not create barriers to accessing information. To be accessible, scripting events must be robust enough so the information can be accessed without using a computer mouse and can be read by assistive technologies. For example, event listeners may be waiting on a user to click on an object or hover over an icon for more information. This could become an error if there is no way for a user who does not use a mouse to access the information. If the information is still hidden even when it has keyboard focus but not mouse focus, it certainly is an accessibility issue. Alternatives for a hover interaction are available and must be implemented in the page.

  Why is it important?

Accessible scripting is critical to ensure all users, including users with disabilities, have equal access to information. Scripting can either increase or decrease the accessibility of your webpage. Proper use of JavaScript will increase accessibility.  Additional information, warnings, or instructions can be given to users through JavaScript prompts. If used improperly, however, JavaScript will make a webpage inaccessible. 

Section 508/WCAG 2.0 Summary of Requirement

When pages utilize scripting languages to display content, or to create interface elements, the information provided by the script shall be identified with functional text that can be read by assistive technology.

Best Practices

The best practices for scripting are the following: 

  • Timer based JavaScript events must be long enough to give a user enough time to navigate the information and allow them to extend the time in case they need it.
  • JavaScript can be useful for the functionality of your website, but JavaScript cause some accessibility issues, these include:
    • Navigation: Inability or difficulty navigating using a keyboard or assistive technology.
    • Hidden content: Presentation of content or functionality that is not accessible to assistive technologies.
    • User control: Lack of user control over automated content changes.
    • Confusion/Disorientation: Altering or disabling the normal functionality of the user agent (browser) or triggering events that the user may not be aware of.
  • Provide links to content that appears in event handlers.
  • If an accessible JavaScript implementation is not possible, provide a non-JavaScript alternative for users that do not have JavaScript rendering, using the <noscript> element.

Examples

Slide Show

Below is an example of what an accessible slideshow can look like. A slideshow should provide control buttons to navigate through the slideshow items. 

Skip Navigation

 Below is an example of a "Skip to main Content" link. This allows users to quickly jump to the main content of the webpage so they do not have to tab through each menu item before reaching the page's content.

back to top

How to Test

Testing methods may vary depending on the scripting language. Typically testing of the scripting language will require a review of its functionality with assistive technologies.

Manual Review

When a scripting event is used in a webpage, it must undergo various accessibility test to ensure the scripting event is functional for keyboard and assistive technology users.  The following test should be conducted: 

  1. Manual test to verify if mouse-handled events are accessible via the keyboard only. Review the keyboard accessibility criteria page for all test associated with keyboard access
  2. Manual test to verify if the scripting events are accessible to assistive technologies. The most common assistive technologies used to test scripting events include screen readers such as  JAWS, NVDA, or VoiceOver

 Automated Testing Tools

Compliance Sheriff

Compliance Sheriff uses Checkpoint group Section L for scripting. Please note that Compliance Sheriff will only identify a scripting event but will not conduct an accessibility check. A manual review is always needed. For more information regarding the checkpoints visit the CSU ATI Accessibility Requirements page. 

Resources