Other issues of accessibility of Javascript
| |
Print |
Send |
Share |
Warning: the original version of this document is Creating Accessible JavaScript: Other Issues . This French translation was done by Ideos under an agreement between WebAIM and Ideos .
Note: See page documents on web accessibility for a list of all translated documents. Other resources on web accessibility are also listed in the digital portal accessible .
Summary
- Page 1: Introduction
- Page 2: JavaScript event handler
- You are on Page 3: Other issues of accessibility of Javascript
- Page 4: Alternatives to JavaScript
- Page 5: Summary for accessible Javascript
Dynamic HTML and accessibility
Dynamic HTML (DHTML) is usually a combination of CSS and JavaScript. DHTML allows developers to display, hide or move information based on user input or pre-programmed commands. Many examples in this section used the DHTML. Most of the drop-down menus found on web pages also use DHTML. Because most of these DHTML elements are modified based on mouse input, they are generally inaccessible to users who do not use a mouse. When using the DHTML, two points must be evaluated to determine its impact on accessibility:
- Is the event used to trigger a change is independent of devices? If the mouse is required, then it is not fully accessible.
- Is the content or DHTML functionality is available? If assistive technology can not adequately access the content or functionality DHTML triggered, then it is not fully accessible.
Use document.write
Dynamic information and evolving are written below in the page by using the JavaScript document.write .
In most cases, the content is written in a page's JavaScript is accessible to assistive technologies.
However, if the dynamic content is constantly changing or interfere with navigation or functionality of the browser, it can create accessibility problems.
Example document.write
The current time is displayed in the text field below. It updates and changes every second.
Pop-up
The pop-up windows are unique in the theme accessibility. First, most experts ergonomics are against the use of pop-ups, except as required. If you must use pop-ups, you should know that they create more accessibility problems. For a sighted user, it may be difficult to notice and navigate within. For someone who uses assistive technology, the new window can be tedious and confusing because the default behavior of the link has changed. The implementation of the JavaScript can make it difficult or impossible to resize it, which is very embarrassing for a person using a screen magnifier. For someone who is blind, there is usually no indication that he is spirited to navigate in a new window. When the user attempts to return to the previous page by clicking the back button, it can be confusing to see that this does not work.
Example of pop-up
Select this link to open a new window
onclick = "window.open (this.href) return false;"> Select this link to open a new window </ a>
Comment
+ Entrée avec le lien sélectionné). If you use software to block pop-ups, you must disable it or choose the link in a way that bypasses the blocked pop-up (usually Ctrl + click or Ctrl + Enter with the link selected).
In the code example above, the link will continue to function normally (eg, in the same browser window) if JavaScript is disabled.
When using JavaScript to open new windows, you can change the size and position of the new window. You can also add or remove features of the window, like the ability to resize, display the scroll bars to display the toolbars, etc.. Be very careful when changing the default behavior of the browser window. If a user with low vision to expand the content, a small window that can not be extended and can not display the scroll bars would be inaccessible. A person with a mobility impairment can be based on large toolbars to precisely control the Web browser. therefore, delete or change can create difficulties for the user.
As you can see, there are many difficulties for both usability and accessibility that arise through the use of pop-ups. Care must be taken when deciding to use them. If used, extensive user testing are essential to ensure accessibility. Always warn the user that a pop-up window opens.
Redirection and refresh browser windows
When the browser displays the page suddenly changes or refreshments, the person viewing this page may be confused or have some confusion, especially if that person uses assistive technology. This is what happens with redirection pages when the content of the page has been moved or updated. Section 508 requires that users retain control over the content changes over time. Do not change automatically or refresh the browser window without first alerting the user that the change will occur and giving him the ability to disable or delay the change.
Use CSS valid as an alternative to JavaScript
As previously mentioned, the CSS are often modified with JavaScript to create DHTML pages dynamically changing. However, with the arrival of version 2 of CSS, many of the features available with the dynamic JavaScript is now included in the CSS specification. This allows the construction of a dynamic and interactive navigation and arrangement of elements without the use of JavaScript events. You can create drop-down menus, image maps and other features on Web sites without worrying about event handlers dependent devices. However, the new CSS standards are not fully supported by modern browsers, namely Internet Explorer.
Screen readers are not of great CSS support, especially with content that can be made visible or invisible by using the style display:none or visibility:hidden .
Many screen readers do not read the contents with the styles, even if the content is still part of the underlying structure of the page.
Until there is no better CSS support in web browsers and assistive technologies, using only CSS to produce dynamic content should be done with a lot of testing in multiple browsers and readers of different screen.
Commercial links
Copyright 1999-2009 WebAIM












![[Paris, December 6 2011] THE conference of the presidential campaign Web 2012 (Ideos / 2.0 Elect partner)](http://www.elus20.fr/images/pdffrance2011_elus20.jpg)























