[英]Is window.confirm() accessible?
像window.confirm
、 window.alert
和window.prompt
这样的原生浏览器模式是否可以访问,还是实现一些自定义的东西更好?
There isn't a whole lot of info out there on this, but I believe the answer is yes (for the most part).关于这方面的信息并不多,但我相信答案是肯定的(在大多数情况下)。 It seems that previously screen readers didn't have support for alerts/window dialogs but screen readers have come to support these in today's world.
以前的屏幕阅读器似乎不支持警报/窗口对话框,但在当今世界,屏幕阅读器已经开始支持这些。
"Although JavaScript pop-up alert boxes were once discouraged by accessibility experts, modern screen readers and browsers provide excellent support for the basic JavaScript alert box." “虽然 JavaScript 弹出式警告框曾经被可访问性专家劝阻,但现代屏幕阅读器和浏览器为基本的 JavaScript 警告框提供了出色的支持。”
http://accessibility.psu.edu/scripts/alertboxes/#basic http://accessibility.psu.edu/scripts/alertboxes/#basic
https://www.w3.org/TR/2018/WD-wai-aria-practices-1.2-20180719/examples/dialog-modal/alertdialog.html https://www.w3.org/TR/2018/WD-wai-aria-practices-1.2-20180719/examples/dialog-modal/alertdialog.html
Reading through the w3 documentation, it seems as though it's more preferred to make your own and specify the appropriate aria
attributes通读 w3 文档,似乎更喜欢自己制作并指定适当的
aria
属性
Update: Read the bottom of this answer.更新:阅读此答案的底部。 According to this answer , they are accessible to most screen-readers, but not JAWS which (as of this December 2017 article) has 46% of the market share.
根据这个答案,大多数屏幕阅读器都可以访问它们,但 JAWS 不可以(截至2017 年 12 月的这篇文章)拥有 46% 的市场份额。 So, 46% of the people using screen-readers uses a screen-reader that does not support
window.confirm
, so it is probably better to make a custom dialog box with the respective aria-*
attributes.因此,使用屏幕阅读器的人中有 46% 使用的屏幕阅读器不支持
window.confirm
,因此最好使用各自的aria-*
属性制作自定义对话框。
My testing gives these results:我的测试给出了这些结果:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.