Technique summary for additional techniques to enhance accessibility of essential scripts
Even when scripts are directly accessible, they might create a barrier when scripting capabilities are disabled in the browser or when the browser or assistive technology configuration does not support scripts. Therefore, the following techniques are recommended to enhance accessibility:
- The <noscript> element can be used to provide alternative content or to contain a link to an alternative Web page with equivalent content and functionality. See the example below:
- Use a server-side script instead of or in addition to a client-side script to provide equivalent functionality. Server-side scripts do not require additional accessibility techniques.
- Provide an equivalent alternative that doesn't require scripting. The link to the alternative could be a link in the page content or inside the <noscript> element.
In the example text below, the accessible JavaScript allows the user to select a Web page. An additional alternative link is added which points to another HTML file (selectPage.html) that contains a text link to each Web page. This is an enhanced way to provide accessibility for browsers that don't support scripting:
<noscript>
<a href="selectPage.html">Select a page</a>
</noscript>
<script language="javascript">
<!--
function goLink() {
linkPage = document.quickMenu.link.options[document.quickMenu.
link.selectedIndex].value;
if (linkPage == "") {
return;
}
else {
self.location = linkPage;
}
}
...
// -->
</script>
<form name="quickMenu">
<label>Select a page to link to:
<select name="link">
<option value="">Select A Page</option>
<option value=""></option>
<option value="webscripts_eventhandlers.html#dropdown_
example4">Stay on this page</option>
<option value="webscripts.html">Scripts main page</option>
</select>
<input type="button" name="Go" value="Go" onclick="goLink()">
</label>
</form>
...
<body>
<noscript>
<p>
<a href="no_script_pages.html">Equivalent alternative
pages</a></p>
</noscript>
<script language="JavaScript1.1" type="text/javascript">
<!-- ...
| Recommended: |
|---|
|
Related script techniques
- Scripts used for background processing and pop-ups
- Scripts using event handlers
- Hidden content, document.write, and scripts that modify content
- DHTML
©2001, 2008 IBM Corporation
Last updated February 28, 2008.
