Download Tuesday Tips - Montgomery College

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

URL redirection wikipedia , lookup

Transcript
ACCESSIBILITY@MC
Tuesday Tips on creating accessible electronic information
December 2, 2014
How to make your websites, documents, course content, and videos accessible
INTRODUCTION
SECTION 508 1194.22(l)
STANDARD
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.
The Section 508 Standards are part of the Federal Acquisition Regulation
(FAR) and address access for people with physical, sensory, or cognitive
disabilities. They contain technical criteria specific to various types of
technologies and performance-based requirements which focus on functional
capabilities of covered products. Specific criteria cover software applications
and operating systems, web-based information and applications, computers,
telecommunications products, video and multi-media, and self-contained
closed products. Today we will address the topic of the Use of Scripting
Language.
Who could use this tip? Faculty, staff, Content Managers, Web Developers,
Multimedia/Audio–Visual presenters, and MCTV
Techniques for Addressing Accessibility – Use of Scripting Language
A scripting language is a programming language that supports scripts, programs written for a
special run-time environment that can interpret and automate the execution of tasks that could
alternatively be executed by a human operator. Environments that can be automated through
scripting include software applications, web pages within a web browser, the shells of operating
systems and embedded systems. A scripting language can be viewed as a domain-specific
language for a particular environment; in the case of scripting an application, this is also known as
an extension language. Scripting languages are also sometimes referred to as very high-level
programming languages, as they operate at a high level of abstraction.
Two types of scripting languages
Server-side and client-side. Server-side scripting performs all of its processing on the web server and
delivers a final product (the web page) to the user's browser. Server-side scripting does not
normally present accessibility problems.
In contrast, client-side scripting is scripting that does all of its processing on the user's computer. It is
commonly used to create pop-up windows, instant-redirect pull-down menus, shopping-cart
calculations, and mouse-over effects.
Basically, the standard says that no matter how scripting is used -- server-side or client-side;
JavaScript, ASP, .Net, PHP, or ColdFusion -- the end result that is interpreted by the browser must be
accessible to users of assistive technology.
The Guidelines
There is general agreement on many of the basic principles involved. The Web Content
Accessibility Guidelines 1.0 [1], which are defined by the World Wide Web Consortium (W3C),
includes five guidelines that specifically address scripting issues:
ACCESSIBILITY@MC
Tuesday Tips on creating accessible electronic information
December 2, 2014
How to make your websites, documents, course content, and videos accessible
•
6.3 Ensure that pages are usable when scripts, applets, or other programmatic objects are
turned off or not supported. If this is not possible, provide equivalent information on an alternative
accessible page. [Priority 1]
For example, ensure that links that trigger scripts work when scripts are turned off or not supported
(e.g., do not use "JavaScript:" as the link target). If it is not possible to make the page usable
without scripts, provide a text equivalent with the NOSCRIPT element, or use a server-side script
instead of a client-side script, or provide an alternative accessible page as per checkpoint 11.4.
•
6.4 For scripts and applets, ensure that event handlers are input device-independent.
[Priority 2]
•
6.5 Ensure that dynamic content is accessible or provide an alternative presentation or
page. [Priority 2]
For example, in HTML, use NOFRAMES at the end of each frameset. For some applications, serverside scripts may be more accessible than client-side scripts.
•
8.1 Make programmatic elements such as scripts and applets directly accessible or
compatible with assistive technologies. [Priority 2]
•
9.3 For scripts, specify logical event handlers rather than device-dependent event handlers.
[Priority 2]
The following additional resources explore accessible scripting in greater detail, including
specific examples of typical scripting functions and techniques:




Guide to the Section 508 Standards —Script-related portion of the Access Board's web
accessibility guide.
IBM Human Ability and Accessibility Center Developer guidelines —Scripts tips written to
accompany the IBM Web Accessibility Checklist .
Javascript Accessibility Issues —Tips from the Trace Center on using Javascript to increase
accessibility.
Client-side Scripting Techniques for Web Content Accessibility Guidelines 2.0 —a W3C
Working Draft
The following AccessIT Knowledge Base articles might also be of interest:



Are "QuickLinks" dropdown lists accessible?
Are all Web users today using Javascript-enabled browsers?
Is it possible to develop an accessible dynamic menu?
ACCESSIBILITY@MC
Tuesday Tips on creating accessible electronic information
December 2, 2014
How to make your websites, documents, course content, and videos accessible
JavaScript
JavaScript is the most popular client-side scripting language. It is a fundamental tool used by Web
developers to interact with the user, control the browser and dynamically create HTML content.
JavaScript is entirely acceptable to use on your Web pages, and it can even be applied to
enhance the accessibility of a Web site. For example, additional information, warnings, and
instructions can be given to users through JavaScript prompts. However, the accessibility of
JavaScript is entirely dependent on what techniques a Web developer chooses.
JavaScript uses event handlers along with HTML code to create an action which is triggered by a
browser or user event, for example, the mouse moves, a key is pressed, the document is loaded, or
a form is submitted. Some event handlers are dependent upon the use of a mouse or keyboard.
These are called device-dependent event handlers. Other event handlers are deviceindependent and are triggered by both the mouse and keyboard, or by other means. Using
device-dependent event handlers may cause the content to be inaccessible to someone that is
not able to use the device that is required for that specific event handler.
Generally, only those event handlers that are device-independent should be used, unless the
event handler is used only for cosmetic purposes in which no content or functionality of the page is
altered. One rule of thumb: if the essential tasks of the web site can be accomplished with
scripting turned off or in a browser that doesn't support scripting, then the scripting is considered
non-essential and does not need to be directly accessible.
Many techniques for creating accessible JavaScript are explained below. However, this
information does not cover the entire range of techniques and/or methodologies that should be
used. For detailed tutorials and examples of different techniques, see the list of related links at the
bottom of this page.
Follow standard coding practices
Follow W3C best practices by including the LANGUAGE and TYPE attributes within the <SCRIPT>
element:
Technique:
<SCRIPT language="JavaScript" type="text/JavaScript">
Use the <NOSCRIPT> element
Always include functional information within the <NOSCRIPT> element. The <NOSCRIPT> element
does not make the script accessible, however, it provides alternative text for the JavaScript if the
end user does not have JavaScript enabled (e.g., older browser, cell phone, PDA, etc.). Making
JavaScript natively accessible is very important. The <NOSCRIPT> content only displays if JavaScript
is disabled. Most screen reader users have JavaScript enabled, and therefore they will encounter
your inaccessible script and not the <NOSCRIPT> content.
ACCESSIBILITY@MC
Tuesday Tips on creating accessible electronic information
December 2, 2014
How to make your websites, documents, course content, and videos accessible
Technique:
<SCRIPT language="JavaScript" type="text/JavaScript">
A script here displays current sports scores.
</SCRIPT>
<NOSCRIPT>
<a href="scores.html">See today's sports scores</a>.
</NOSCRIPT>
Use device-independent event handlers
Several event handlers are device-independent, including onFocus, onBlur, onSelect, onChange,
and onClick (when onClick is used with link or form elements). Typically, actions from these event
handlers can be triggered with the mouse, keyboard, or other input device. These generally do
not cause accessibility issues unless they are modifying the default behavior of the Web browser or
are interfering with keyboard navigation within the Web page.
The event handlers onMouseOver and onMouseOut are device-dependent, requiring a mouseclick to activate the script. For some scripts, using onFocus and onBlur in addition to onMouseOver
and onMouseOut can improve accessibility. For other scripts, such as fly-out navigation menus, an
accessible form of redundant navigation is usually required.
Trigger events with active input from users
An active trigger is a mouse click, selection of an option in a list, or a key press. Non-active triggers
are activated when a page is loaded, after a certain amount of time has expired, or when the
mouse passes over an object. Non-active triggers are useful for highlighting information but they
should be used carefully and should not greatly alter the contents of the page, unless notification
is given to the user.
Ensure accessible form validation
JavaScript alerts are read by most modern screen readers and can be used to increase the
usability of forms by providing timely feedback, instructions, or cues. However, validating form
information with a server-side script and then displaying feedback on another Web page is
preferred. This method allows you to bypass any problems that may occur in the JavaScript code
and allows the form to validate if JavaScript is disabled.
If JavaScript is used to display error messages, the error should appear as an alert message rather
than as text that displays back on the page. Commonly, an error appears above the form itself or
elsewhere on the page when a user presses the Submit button if a form field is not properly filled
out. When presented this way, it is only noticeable by visual users. The focus for the screen reader
ACCESSIBILITY@MC
Tuesday Tips on creating accessible electronic information
December 2, 2014
How to make your websites, documents, course content, and videos accessible
user remains on the Submit button, and that user will be completely unaware that an error has
occurred.
Ensure that the code you are using is not browser-specific so that it will present an alert message
across a variety of Web browsers. Additionally, make sure that all form elements and functionality
can be completed using the keyboard.
Ensure that scripts are operable using a keyboard
If you must use device-dependent event handlers, include redundant keyboard event handlers. In
other words, specify two handlers for the same element. Use onMouseDown with onKeyDown. Use
onMouseUp with onKeyUp. Use onClick with onKeyPress.
Using multiple device-dependent event handlers together as a method of implementing device
independence requires a great deal of testing across different browsers and assistive technologies
to ensure that accessibility is not limited in any way.
Because of the general complexity of this topic, Web developers are advised to read more about
this subject from the resources listed below.
RELATED LINKS





Creating Accessible JavaScript
Scripts and Applets
Using JavaScript to increase accessibility
Scripts - 508 Guidelines
Web Content Accessibility Guidelines 1.0
Need HELP with making your website
or document accessible?
Go to Accessibility@MC or contact Luis Gorres,
Accessibility Coordinator at
[email protected] or at
240-567-4370
VALIDATION TECHNIQUES
For more information of test tools see resources at
Accessibility@MC.
Procedure
Check Scripts are keyboard accessible.
Results
Content and functionality provided by scripting is directly
accessible to assistive technologies and the keyboard.
<noscript> content does not constitute a suitable alternative
to inaccessible scripting.
If the content affected by scripting is not accessible, an
alternative is provided.