Javascript and Accessibility

后端 未结 6 474
南旧
南旧 2021-02-01 19:14

As a web developer, a number of the projects I work on fall under government umbrellas and hence are subject to 508 Accessibility laws, and sometimes W3C accessibility guideline

6条回答
  •  佛祖请我去吃肉
    2021-02-01 19:40

    JQuery has the capability to be unobtrusive and therefore accessible. The trick is to have redundancy around your AJAX calls so browsers without JavaScript can still utilize your service. In other words, wherever you have JavaScript responses, dialogs, etc you need to have a degraded equivalent.

    One way to do this to reuse your code, is to have your "simple" page calling a "function" (or whatever you use for server side logic) that can be called by itself, returning JSON or XML.

    For example: /static/myform.asp (in the server side, 'includes' the same logic as /ajax/myform.asp) that way you'd be using asp as django's templates.

    Of course, with a full featured bell and whistles framework, you could make this a lot easier (think of having an html and an xml 'template' for the same view in django), but the same idea applyes.

    Having done this, iterating over all anchors on document ready using jQuery and adding onclick events using the anchor's own link, remplacing /static/ajax/ could make your life easier.

    Can anyone think of reasons for this to be too much of a burden? Would like to know if there is any serious flaw on this 'design idea'.

提交回复
热议问题