[英]Script user interface may not be accessible. WCAG 2.0 (Level AA)
I am trying to make my site accessibility compatible.我正在努力使我的网站可访问性兼容。
I am using achecker.ca to see my errors.我正在使用achecker.ca查看我的错误。
For some reason, all of my script tags are shown as potential error according to WCAG 2.0 (Level AA) Section 2.1, Success Criteria 2.1.1, Check ID 89.出于某种原因,根据WCAG 2.0(AA 级)第 2.1 节,成功标准 2.1.1,检查 ID 89,我的所有脚本标记都显示为潜在错误。
I need to get rid of these potential errors, but personally I do not know how can I make a script accessible that its only job is assigning an object.我需要摆脱这些潜在的错误,但我个人不知道如何使脚本可访问,它的唯一工作是分配对象。 Like this script for example:
比如这个脚本:
<script>
window.dataLayer = [{
"page_details": {
"url": "\/us\/social-channels\/",
"name": "Social channels"
},
}];
</script>
Any ideas how to solve this issue?任何想法如何解决这个问题?
Looking at this specific issue, Check ID 89 , it says:查看此特定问题Check ID 89 ,它说:
Short Description
简短的介绍
This error will be generated for allscript
elements.将为所有
script
元素生成此错误。
and then they have two examples, one passing, one failing.然后他们有两个例子,一个通过,一个失败。
Pass Examples
通过示例
Does not contain ascript
element.不包含
script
元素。
Fail Examples失败示例
Contains ascript
element.包含
script
元素。
So according to the doc, every <script>
is going to be marked as a "potential" problem and there's no way to prevent the warning (short of removing the <script>
).因此,根据文档,每个
<script>
都将被标记为“潜在”问题,并且无法阻止警告(除了删除<script>
)。
Personally, as an accessibility specialist, I think that warning is wrong.就个人而言,作为可访问性专家,我认为该警告是错误的。 Scripts should not be flagged.
不应标记脚本。 If you had code where you have a mouse event handler, then that would definitely be a WCAG 2.1.1 problem.
如果您的代码中有鼠标事件处理程序,那么这肯定是 WCAG 2.1.1 的问题。 But flagging a script generically does not mean anything.
但是一般地标记脚本并不意味着什么。
"Potential problems" means that you have to check manually. “潜在问题”意味着您必须手动检查。 This does not mean that you have any error.
这并不意味着您有任何错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.