Click to See Complete Forum and Search --> : Accessible JavaScript


Susana
08-31-2004, 07:51 AM
Hi,

in order to get our web accessible we need to solve a question:

We employ different ".js" file's to manage content, for common parts (i.e. menu, header...) used in all the pages so if we need to do any change, we donīt need to update all the pages, we just have to update the javascript file (.js file).

To make the site accessible what would be the best solution:

- To put a <noscript> tag with an URL to point to a page with the accessible content or
- to make server-side scripts instead of javascript in the client? or
- to use includes?

is there any better solution??

Thank you!

AdamGundry
08-31-2004, 07:58 AM
The best solution is probably to handle the includes on the server side, using SSI or a more complex language depending on your other needs. You should avoid creating multiple versions, for the reasons outlined in the Web Content Accessibility Guidelines (http://www.w3.org/TR/WCAG10/#alt-page-note).

Adam

Susana
08-31-2004, 11:44 AM
Hi Adam,

thanks for your answer.

Unfortunately server side includes wouldn't be an easy or optim solution for us. Since we use now Javascript (on the client) SSI would make us change completely our publication system. Aswell when we make our server work with jsp, we have a complicated cache system to ensure the bandwidth in case of conexion overflow...


Any other suggestion?

Thanks,

Susana

Jona
08-31-2004, 05:13 PM
While you're going to be partially safe, because most of the people on the Internet nowadays have JavaScript, I would strongly suggest using server-side includes (if possible, with JSP when you move over to it). Depending on JavaScript is a very bad practice, and providing NOSCRIPT tags would mean you would have to update each page manually anyway.

Charles
09-01-2004, 06:10 AM
Originally posted by Jona
[Y]ou're going to be partially safe, because most of the people on the Internet nowadays have JavaScript&hellip; No, you are going to be in great trouble. This a question of accessibility and some people cannot use JavaScript because of some disability - and some of us don't use it to defend ourselves from awful web authors.From the Web Content Accessibility Guidelines 1.0 (http://www.w3.org/TR/WCAG10/)
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.

Jona
09-01-2004, 11:44 PM
Charles, I wasn't suggesting or encouraging the dependency of JavaScript; what I meant was that most of the users of the Internet do have it enabled. Hence, the majority have access to the content. I am absolutely not agreeing with the use of JavaScript where it should not be used. Sorry if my post was not clear enough on that.

Charles
09-02-2004, 05:46 AM
Originally posted by Jona
Charles, I wasn't suggesting or encouraging the dependency of JavaScript; what I meant was that most of the users of the Internet do have it enabled. Hence, the majority have access to the content. I am absolutely not agreeing with the use of JavaScript where it should not be used. Sorry if my post was not clear enough on that. But the question that we are addressing, the topic of this forum and our moral obligation is accessibility. And "accessible" means "works on every browser".

Jona
09-02-2004, 03:34 PM
I'm not going to argue the point, Charles; you're right. ;)

Stephen Philbin
09-02-2004, 03:57 PM
Something I thought about when making a moving menu (which I'm still managing to screw up) using javacripting and keeping it accessible (amongst other things), was a suprisingly simple solution that lets the whole thing degrade rather nicely and doesn't even require the noscript tags.

Doubtless many like Charles and Vladdy will already be well aware of such an idea but here goes anyway:

Make the javascript the thing that makes it inaccessible without javascript, not the original markup its self.

I often look at the source of others and have noticed that in many cases (things like menus especially) that the initial markup is the thing that is the problem when no js is available. A section of a nav menu having {display:none;} when a page initially loads, and then a DOMstring changes the propert with a mouseover or click or whatever.

However I realised that it's perfectly easy to make the menu available initially and then use an onload event to make it inaccessible to people that don't have JS (naturally the onload will never happen for these people though and the menu remains accessible though). Then use the appropriate DOMstrings to operate the menu as desired to those that have it available. I know it doesn't apply to quite a lot of other situations, but hey, it's a good start right?

I hope that made sense to everyone, I know I didn't do a very good job of explaining it.

Webnauts
09-23-2004, 08:18 AM
Susanna and to all who may be concerned, I think you might would like to have a look at this resource, which I guess will answer all your questions about Accessible JavaScript: http://www.webaim.org/techniques/javascript/