SlideShare une entreprise Scribd logo
1  sur  24
JavaScript and Accessibility
You can do this. It's fine.
JavaScript gets a lot of negative
press for accessibility:
JavaScript gets a lot of negative
press for accessibility:
Why?
JavaScript is high risk
- Great JavaScript is completely accessible.
- Bad JavaScript tends to be completely inaccessible.
- JavaScript removes a lot of middle ground...
Accessibility dependencies:
- Solid HTML basics
- Predictable and controllable interaction
- Clear communication of results
Solid HTML Basics
- Use <label> element on inputs
- Includes standard controls to trigger action
- Uses good semantic structures
- Clearly reports results to the user
Predictable and controllable interaction
- Use buttons and inputs to collect data or trigger events
- Don't trigger events automatically
Clear communication of results
- Move focus to results if an event is for navigation
- Make response regions "live" if an event is informational
- Make sure responses provide meaningful context
JavaScript does all of this.
JavaScript does all of this.
...so where's the problem?
Angular Example: (from W3Schools)
<!DOCTYPE html>
<html lang="en-US">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="">
<p>Name : <input type="text" ng-model="name"></p>
<h1>Hello {{name}}</h1>
</div>
</body>
</html>
Problems with that example?
1) Unlabeled input
2) Feedback happens on keypress
3) No ARIA live attribute on output
4) Non-semantic HTML structures
Problems with that example?
1) Unlabeled input
2) Feedback happens on keypress
3) No ARIA live attribute on result
4) Non-semantic HTML structures
Result: inaccessible form.
Problem with JavaScript?
Problems with that example?
1) Unlabeled input
2) Feedback happens on keypress
3) No ARIA live attribute on result
4) Non-semantic HTML structures
Result: inaccessible form.
Problem with JavaScript?
NO.
JavaScript is
accessible...
...if it's used
intelligently.
Write Intelligent JavaScript
- Use ARIA (but not too much)
- Use HTML Controls
- Don't make events automatic
- Follow keyboard focus
Case Study:
Improve Accessibility with AJAX
The WordPress comment form
Why add AJAX?
- The default error page directs to a new screen
- The error page doesn't provide direct access to fixing issues
- A successful comment requires a page refresh
The WordPress comment form
Example 1:
https://github.com/joedolson/inaccessible-ajax-comments
Example 2:
https://github.com/joedolson/accessible-ajax-comments
JavaScript: Improve Accessibility
- Toggle state using aria-pressed or aria-checked attributes
- Manage form validation
- Simplify user interfaces by hiding and showing UI elements
- Prevent unnecessary page refreshes and changes of focus
What do I need to be careful about?
- Mouse dependencies: onMouseOut, onMouseOver,
onDblClick
- Keyboard dependencies: onKeyDown, onKeyUp
- Automatic changes: onSelect, onChange
- Controlling focus
- Hidden content
Ensuring Accessibility with JS Libraries
- Know the library deeply
- Know what HTML it's rendering
- Know whether hidden content is really hidden
- Know what controls you're using with it
- Know how it handles from the keyboard
How do I make MY code accessible?
- What controls are you using?
- Is the current state of a multi-state control available?
- Where is focus moving after an event?
- Does this event cause the DOM to change?

Contenu connexe

Tendances

Developing great applications using ASP.NET MVC and ASP.NET AJAX
Developing great applications using ASP.NET MVC and ASP.NET AJAXDeveloping great applications using ASP.NET MVC and ASP.NET AJAX
Developing great applications using ASP.NET MVC and ASP.NET AJAX
Tatham Oddie
 
Ajax: User Experience
Ajax: User ExperienceAjax: User Experience
Ajax: User Experience
petrov
 
Iterating In the Open
Iterating In the OpenIterating In the Open
Iterating In the Open
Dave Hodson
 
Some great tools
Some great toolsSome great tools
Some great tools
bh Kyung
 

Tendances (20)

HowWebWorks
HowWebWorksHowWebWorks
HowWebWorks
 
The what, why and how of web analytics testing
The what, why and how of web analytics testingThe what, why and how of web analytics testing
The what, why and how of web analytics testing
 
Keeping Things Simple In A Growing AngularJS App.
Keeping Things Simple In A Growing AngularJS App.Keeping Things Simple In A Growing AngularJS App.
Keeping Things Simple In A Growing AngularJS App.
 
Introduction to Mantis
Introduction to MantisIntroduction to Mantis
Introduction to Mantis
 
Taking Web Applications Offline
Taking Web Applications OfflineTaking Web Applications Offline
Taking Web Applications Offline
 
ASP.Net MVC ile Web Uygulamaları - 4(Model)
ASP.Net MVC ile Web Uygulamaları - 4(Model)ASP.Net MVC ile Web Uygulamaları - 4(Model)
ASP.Net MVC ile Web Uygulamaları - 4(Model)
 
Asp.netmvc handson
Asp.netmvc handsonAsp.netmvc handson
Asp.netmvc handson
 
Developing great applications using ASP.NET MVC and ASP.NET AJAX
Developing great applications using ASP.NET MVC and ASP.NET AJAXDeveloping great applications using ASP.NET MVC and ASP.NET AJAX
Developing great applications using ASP.NET MVC and ASP.NET AJAX
 
How To Get Your Website Indexed Almost Immediately
How To Get Your Website Indexed Almost ImmediatelyHow To Get Your Website Indexed Almost Immediately
How To Get Your Website Indexed Almost Immediately
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
 
Getting amped for amp
Getting amped for ampGetting amped for amp
Getting amped for amp
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
Understanding ASP.NET MVC
Understanding ASP.NET MVCUnderstanding ASP.NET MVC
Understanding ASP.NET MVC
 
What is WAAT?
What is WAAT?What is WAAT?
What is WAAT?
 
Ajax: User Experience
Ajax: User ExperienceAjax: User Experience
Ajax: User Experience
 
Iterating In the Open
Iterating In the OpenIterating In the Open
Iterating In the Open
 
Webforms or MVC
Webforms or MVCWebforms or MVC
Webforms or MVC
 
Some great tools
Some great toolsSome great tools
Some great tools
 
How to make your functional tests really quick
How to make your functional tests really quickHow to make your functional tests really quick
How to make your functional tests really quick
 
How to Handle Multiple Windows in Selenium Webdriver | Edureka
How to Handle Multiple Windows in Selenium Webdriver | EdurekaHow to Handle Multiple Windows in Selenium Webdriver | Edureka
How to Handle Multiple Windows in Selenium Webdriver | Edureka
 

En vedette (9)

E10 Merry Peter What on Earth Netherlands 1104
E10 Merry Peter What on Earth Netherlands 1104E10 Merry Peter What on Earth Netherlands 1104
E10 Merry Peter What on Earth Netherlands 1104
 
C7 s di intro beck integral naked
C7 s di intro beck integral nakedC7 s di intro beck integral naked
C7 s di intro beck integral naked
 
Massively maintained accessibility: WordPress
Massively maintained accessibility: WordPressMassively maintained accessibility: WordPress
Massively maintained accessibility: WordPress
 
C4 The Never Ending Upward Quest 2002
C4 The Never Ending Upward Quest 2002C4 The Never Ending Upward Quest 2002
C4 The Never Ending Upward Quest 2002
 
Maria zepeda testimony
Maria zepeda testimonyMaria zepeda testimony
Maria zepeda testimony
 
D4 merry peter reflections s di
D4 merry peter   reflections s diD4 merry peter   reflections s di
D4 merry peter reflections s di
 
Programa (arnold rodriguez)
Programa (arnold rodriguez)Programa (arnold rodriguez)
Programa (arnold rodriguez)
 
E9 beck don the global great divide
E9 beck don   the global great divideE9 beck don   the global great divide
E9 beck don the global great divide
 
C9 gibb primer on s di in organizations
C9 gibb primer on s di in organizationsC9 gibb primer on s di in organizations
C9 gibb primer on s di in organizations
 

Similaire à JavaScript and Accessibility

Understanding progressive enhancement - yuiconf2010
Understanding progressive enhancement - yuiconf2010Understanding progressive enhancement - yuiconf2010
Understanding progressive enhancement - yuiconf2010
Christian Heilmann
 

Similaire à JavaScript and Accessibility (20)

Accessible java script
Accessible java scriptAccessible java script
Accessible java script
 
Understanding progressive enhancement - yuiconf2010
Understanding progressive enhancement - yuiconf2010Understanding progressive enhancement - yuiconf2010
Understanding progressive enhancement - yuiconf2010
 
JavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern ImplementationJavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern Implementation
 
Techniques For A Modern Web UI (With Notes)
Techniques For A Modern Web UI (With Notes)Techniques For A Modern Web UI (With Notes)
Techniques For A Modern Web UI (With Notes)
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Using Ajax to improve your user experience at Web Directions South 2009
Using Ajax to improve your user experience at Web Directions South 2009Using Ajax to improve your user experience at Web Directions South 2009
Using Ajax to improve your user experience at Web Directions South 2009
 
TPR4
TPR4TPR4
TPR4
 
TPR4
TPR4TPR4
TPR4
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
jQuery Ecosystem
jQuery EcosystemjQuery Ecosystem
jQuery Ecosystem
 
GWT
GWTGWT
GWT
 
Introduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and SilverlightIntroduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and Silverlight
 
Testing For Web Accessibility
Testing For Web AccessibilityTesting For Web Accessibility
Testing For Web Accessibility
 
Selenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web ApplicationsSelenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web Applications
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalore
 
Building accessible web components without tears
Building accessible web components without tearsBuilding accessible web components without tears
Building accessible web components without tears
 
High performance websites session1
High performance websites  session1High performance websites  session1
High performance websites session1
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NET
 
AJAX Patterns with ASP.NET
AJAX Patterns with ASP.NETAJAX Patterns with ASP.NET
AJAX Patterns with ASP.NET
 

Plus de Joseph Dolson

Build a WordPress Plug-in: Accessible social sharing
Build a WordPress Plug-in: Accessible social sharingBuild a WordPress Plug-in: Accessible social sharing
Build a WordPress Plug-in: Accessible social sharing
Joseph Dolson
 
SES Toronto 2008; Joe Dolson
SES Toronto 2008; Joe DolsonSES Toronto 2008; Joe Dolson
SES Toronto 2008; Joe Dolson
Joseph Dolson
 

Plus de Joseph Dolson (20)

Why #A11y?
Why #A11y? Why #A11y?
Why #A11y?
 
WordPress and ATAG Compliance
WordPress and ATAG ComplianceWordPress and ATAG Compliance
WordPress and ATAG Compliance
 
If you build it, they will come.
If you build it,  they will come.If you build it,  they will come.
If you build it, they will come.
 
Electronic information and accessible technology
Electronic information and accessible technologyElectronic information and accessible technology
Electronic information and accessible technology
 
The WordPress Way: Accessibility and Backwards Compatibility
The WordPress Way: Accessibility and Backwards CompatibilityThe WordPress Way: Accessibility and Backwards Compatibility
The WordPress Way: Accessibility and Backwards Compatibility
 
WordCamp US: ARIA. Roles, States and Properties
WordCamp US: ARIA. Roles, States and PropertiesWordCamp US: ARIA. Roles, States and Properties
WordCamp US: ARIA. Roles, States and Properties
 
Build a WordPress Plug-in: Accessible social sharing
Build a WordPress Plug-in: Accessible social sharingBuild a WordPress Plug-in: Accessible social sharing
Build a WordPress Plug-in: Accessible social sharing
 
Automating Accessibility: WordCamp Minneapolis 2015
Automating Accessibility: WordCamp Minneapolis 2015Automating Accessibility: WordCamp Minneapolis 2015
Automating Accessibility: WordCamp Minneapolis 2015
 
Good Habits: Coding for Accessibility - WordCamp San Francisco 2014
Good Habits: Coding for Accessibility - WordCamp San Francisco 2014Good Habits: Coding for Accessibility - WordCamp San Francisco 2014
Good Habits: Coding for Accessibility - WordCamp San Francisco 2014
 
Accessibility With WordPress: Accessing Higher Ground 2014
Accessibility With WordPress: Accessing Higher Ground 2014Accessibility With WordPress: Accessing Higher Ground 2014
Accessibility With WordPress: Accessing Higher Ground 2014
 
The Accessible Web: Improving the Universal Experience
The Accessible Web: Improving the Universal ExperienceThe Accessible Web: Improving the Universal Experience
The Accessible Web: Improving the Universal Experience
 
Mission: Accessible. Share & Connect Online with Everybody!
Mission: Accessible. Share & Connect Online with Everybody!Mission: Accessible. Share & Connect Online with Everybody!
Mission: Accessible. Share & Connect Online with Everybody!
 
WordPress Accessibility: WordCamp Chicago
WordPress Accessibility: WordCamp ChicagoWordPress Accessibility: WordCamp Chicago
WordPress Accessibility: WordCamp Chicago
 
Encouraging Accessibility
Encouraging AccessibilityEncouraging Accessibility
Encouraging Accessibility
 
Accessibility with WordPress
Accessibility with WordPressAccessibility with WordPress
Accessibility with WordPress
 
Accessibility & WordPress: Developing for the whole world.
Accessibility & WordPress: Developing for the whole world.Accessibility & WordPress: Developing for the whole world.
Accessibility & WordPress: Developing for the whole world.
 
WordPress and Accessibility
WordPress and AccessibilityWordPress and Accessibility
WordPress and Accessibility
 
Accessible Web Sites: What can you do?
Accessible Web Sites: What can you do?Accessible Web Sites: What can you do?
Accessible Web Sites: What can you do?
 
Web Accessibility: A Shared Responsibility
Web Accessibility: A Shared ResponsibilityWeb Accessibility: A Shared Responsibility
Web Accessibility: A Shared Responsibility
 
SES Toronto 2008; Joe Dolson
SES Toronto 2008; Joe DolsonSES Toronto 2008; Joe Dolson
SES Toronto 2008; Joe Dolson
 

Dernier

在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
ydyuyu
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 

Dernier (20)

在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 

JavaScript and Accessibility

  • 1. JavaScript and Accessibility You can do this. It's fine.
  • 2. JavaScript gets a lot of negative press for accessibility:
  • 3. JavaScript gets a lot of negative press for accessibility: Why?
  • 4. JavaScript is high risk - Great JavaScript is completely accessible. - Bad JavaScript tends to be completely inaccessible. - JavaScript removes a lot of middle ground...
  • 5. Accessibility dependencies: - Solid HTML basics - Predictable and controllable interaction - Clear communication of results
  • 6. Solid HTML Basics - Use <label> element on inputs - Includes standard controls to trigger action - Uses good semantic structures - Clearly reports results to the user
  • 7. Predictable and controllable interaction - Use buttons and inputs to collect data or trigger events - Don't trigger events automatically
  • 8. Clear communication of results - Move focus to results if an event is for navigation - Make response regions "live" if an event is informational - Make sure responses provide meaningful context
  • 10. JavaScript does all of this. ...so where's the problem?
  • 11. Angular Example: (from W3Schools) <!DOCTYPE html> <html lang="en-US"> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <body> <div ng-app=""> <p>Name : <input type="text" ng-model="name"></p> <h1>Hello {{name}}</h1> </div> </body> </html>
  • 12. Problems with that example? 1) Unlabeled input 2) Feedback happens on keypress 3) No ARIA live attribute on output 4) Non-semantic HTML structures
  • 13. Problems with that example? 1) Unlabeled input 2) Feedback happens on keypress 3) No ARIA live attribute on result 4) Non-semantic HTML structures Result: inaccessible form. Problem with JavaScript?
  • 14. Problems with that example? 1) Unlabeled input 2) Feedback happens on keypress 3) No ARIA live attribute on result 4) Non-semantic HTML structures Result: inaccessible form. Problem with JavaScript? NO.
  • 17. Write Intelligent JavaScript - Use ARIA (but not too much) - Use HTML Controls - Don't make events automatic - Follow keyboard focus
  • 19. The WordPress comment form Why add AJAX? - The default error page directs to a new screen - The error page doesn't provide direct access to fixing issues - A successful comment requires a page refresh
  • 20. The WordPress comment form Example 1: https://github.com/joedolson/inaccessible-ajax-comments Example 2: https://github.com/joedolson/accessible-ajax-comments
  • 21. JavaScript: Improve Accessibility - Toggle state using aria-pressed or aria-checked attributes - Manage form validation - Simplify user interfaces by hiding and showing UI elements - Prevent unnecessary page refreshes and changes of focus
  • 22. What do I need to be careful about? - Mouse dependencies: onMouseOut, onMouseOver, onDblClick - Keyboard dependencies: onKeyDown, onKeyUp - Automatic changes: onSelect, onChange - Controlling focus - Hidden content
  • 23. Ensuring Accessibility with JS Libraries - Know the library deeply - Know what HTML it's rendering - Know whether hidden content is really hidden - Know what controls you're using with it - Know how it handles from the keyboard
  • 24. How do I make MY code accessible? - What controls are you using? - Is the current state of a multi-state control available? - Where is focus moving after an event? - Does this event cause the DOM to change?

Notes de l'éditeur

  1. Example 1: without ARIA, this change makes an improved experience for most users, but breaks it completely for screen reader users. Example 2: With ARIA, this is a major improvement for users with screen readers as well. See diff: only a handful of attributes make this difference.