Main Menu

Welcome to the December 2005 edition of our monthly

Accessibility Tip

December 2005

Each month we would like to bring to you a tip on how you can improve the accessibility of your website. Each tip will contain details on a particular issue that faces people with disabilities, how it affects people and what you can do to resolve it.

This month we are discussing: To JavaScript or not to JavaScript, that is the question?

The issue

Most websites today uses JavaScript to provide interactive elements such as drop-down menus, to perform client-side validation of forms, to load embedded content such as flash animations or even to generate animations directly.

Depending on what exactly is done with the JavaScript code, it can affect people with different disabilities. For example a person with a mobility impairment may not be able to use a mouse to access the drop-down menus generated using JavaScript. Another example is somebody who suffers from epileptic seizures may be sensitive to the screen flickering caused by animations. In these cases the visitor to your site may have disabled JavaScript completely or may use a browser, such as Lynx, which does not support JavaScript at all.

Another aspect to consider is recent online security bulletins which advices that JavaScript should be disabled to prevent the propagation of certain viruses. This has lead to a large number of sites suddenly not working at all.

Try it for yourself

If you are confident in changing your browser's settings then you can try this for yourself. Change your browser's security settings to disable JavaScript for a particular site you want to test. If you have browsed to the site already then refresh the browser. Note if any parts of the page is no longer visible. Try to access the different menu options using only the keyboard by tabbing through. Can you select any menu options? Can you still reach all parts of the site? If you are looking at a form, can you fill in and post the form without JavaScript enabled? Can you put in nonsense data and will the server just accept it or will it ask you to fix the problems?

As you can see there are many ways in which a site can fail if it relies too much on JavaScript.

Should we then use JavaScript at all on our websites if we want to make the site accessible to everybody? Would it not be better just not to use JavaScript?

The short answer to this question is that it is ok to use JavaScript on a site as long as we ensure that somebody can still use all of the site's functionality even if JavaScript is disabled on their browser or if they use a browser which does not even support JavaScript.

Bruce Aylward, 06 December 2005

About W 3 A

W 3 A provides consultancy and audit services on information accessibility, focussing on Internet accessibility, compliance with the W3C standards and NZ Government Web Guidelines, and website best practice. We have relationships with several charities and government agencies responsible for the interests of the disabled.

Subscription Details

If this tip has been forwarded to you from a friend and you would like to subscribe to receive future editions directly then please use our online subscription form or send an email with subscribe as the subject and containing your name and email address to newsletter@w3a.co.nz.

If you would prefer to receive this newsletter in the Headstar Text Email Newsletter (TEN) format then please just let us know.

Other issues of the Accessibility Tip are available on our articles page.