5

I was wondering if someone has an article of common practices a web developer should practice while using JavaScript on a web page, keeping in mind the web page should be Section 508 compliant. I saw some articles where people were talking about two versions of code -- one working with JavaScript and the other working without JavaScript -- giving users the same level of functionality. Is this the most common approach? Are there some functions in JavaScript which one could use without worrying about being an issue with Section 508 compliance and others where we have to carefully make the equivalent functions using non-JavaScript language like simple HTML?

2

1 Answer 1

11

In order to comply with web accessibility guidelines including Section 508, you must make functionality available to people using assistive technology. This could mean people might be using text-based browsers or screen readers that don't necessarily take advantage of the interactive functionality added using Javascript. Therefore, your best bet is to design for browsers without Javascript. You won't be able to rely on any functionality of Javascript if that's your goal.

The most common approach is to use progressive enhancement and graceful degradation to provide enhanced functionality to those with richer clients while preventing those with different abilities from being unable to complete their goals.

In practice, you want to look at the practice of unobtrusive javascript, use event listeners to capture interactions without degrading default behaviour, and follow accessibility guidelines that I'm sure you're already aware of.

3
  • Hi Rahul, Do you know of some examples or websites having some javascript and Ajax techniques successfully implemented and still accessible? I think I am trying to find some examples, the problem is I am getting conflicting opinions based on several readings on web about javascript usage and it's final reading by the screen readers. Some key interactions which bother me in my design 1. On button click I want the page not to refresh and convert couple of text to text input box 2. Error validation, I don't want the page to refresh and I want to do some basic error checking before submitting form
    – varun86
    Commented Sep 14, 2011 at 5:31
  • 3. The user gets pop up without having a page refresh, this pop might be of different nature a list view with various options or a confirmation message for certain action. If you have examples of such interactions I would appreciate if you could share. Thanks a lot.
    – varun86
    Commented Sep 14, 2011 at 5:33
  • @varun86 I don't have any examples off the top of my head, but Google "unobtrusive javascript" and start following some guides. You'll be able to do what you want to do easily. It boils down to capturing the click event on a hyperlink and executing some javascript (such as displaying an overlay over the page) while preventing the hyperlink from running (using preventDefault and return false).
    – Rahul
    Commented Sep 14, 2011 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.