Making AJAX work for Screenreaders
Accessibility languages and techniques can only function so far as the user understands them. In addition to that, features can be maximized with awareness. “The virtual buffer is referred to as Virtual PC Cursor mode in JAWS. Virtual PC Cursor mode is enabled by default when viewing HTML documents in supported applications (such as Internet Explorer and Firefox with JAWS 7.0), and can be toggled on and off using the keystroke combination Insert + Z. In this mode, the user has access to HTML elements and their attributes, such as the th element for table headings.
When in Virtual PC Cursor mode, JAWS responds inconsistently to client-side scripting events. JAWS is able to respond to basic events in Virtual PC Cursor mode, such as click and keypress, and will refresh the Virtual PC Cursor snapshot to reflect any changes made to the content. The problem when using Ajax is that new content isn’t usually added directly in response to these events; instead, the content is usually added through the onreadystatechange event of the XMLHttpRequest object. Interestingly, JAWS 7.0 responds to the onreadystatechange event with Firefox, but not with Internet Explorer. The lack of response to the onreadystatechange event along with authors failing to focus on the parts of the document that has changed is essentially why most Ajax applications are reported to either not work at all, or behave inconsistently. For changes to be reported successfully to JAWS in Virtual PC Mode (the default mode and the mode that allows the user to interact with the content), the only reliable method of adding new content in Virtual PC Cursor mode is as a direct result of a click, keypress, or mouseover event, which obviously isn’t good enough for an Ajax solution.
From version 6, JAWS introduced a command to refresh the Virtual PC Cursor using the keystroke combination Insert + Esc. This means that a JAWS user can use this keystroke combination to gain access to content that has been added dynamically. The problem is letting the user know that the content has changed. A solution we considered was to add content that prompts the user to refresh the virtual buffer as a direct response to a click/keypress event, and replace that content when the onreadystatechange event is raised in the XMLHttpRequest object. The thinking behind this approach was that users of JAWS 6 and later could use the Refresh Virtual PC Cursor command, and users of earlier versions of JAWS and other screen readers that use a virtual buffer would be able to respond to this by toggling virtual mode on and off — for example, using the keyboard combination Insert + Z twice would toggle the Virtual PC Cursor mode on and off in JAWS, refreshing the virtual buffer.”
Read the full article from Juicy Studio
