简体   繁体   English

脚本用户界面可能无法访问。 WCAG 2.0(AA级)

[英]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 all script elements.将为所有script元素生成此错误。

and then they have two examples, one passing, one failing.然后他们有两个例子,一个通过,一个失败。

Pass Examples通过示例
Does not contain a script element.不包含script元素。
Fail Examples失败示例
Contains a script 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.

相关问题 符合WCAG 2.0 AA会妨碍使用JavaScript吗? - Does compliance to WCAG 2.0 AA prevent the use of JavaScript? 3rd party内容图像没有alt属性且未达到WCAG 2.0 A级-JavaScript解决方案? - 3rd party content images don't have alt attributes and meeting WCAG 2.0 Level A - javascript solution? 在给定的十六进制背景值下找到正确的WCAG AA对比色 - Find the Correct WCAG AA Contrast Color for a Given Hex Background Value 如何使Datepicker符合WCAG 2.0? - How to Make Datepicker Comply with WCAG 2.0? 在“ <input> 无法访问。 是否有一种简单的方法使其可访问(JS),还是我必须放弃它? - Using “required” on an <input> isn't accessible. Is there an easy way to make it accessible (JS) or do I have to abandon it? 使用可能存在或不存在的接口修改全局 - Modify global with an interface that may or may not be there 在链接中添加span元素,以使其可以使用javascript访问(AA) - Add a span element within a link to make it accessible (AA) with javascript &#39;SQLite 错误:没有这样的表&#39;,在连接的数据库上使用 TypeORM,其他表可访问。 有没有特定的方法来访问带有外键的表? - 'SQLite Error: No Such Table' with TypeORM on a connected DB with other tables accessible. Is there a specific way to reach tables with foreign keys? 创建可在5月网站上访问的HTML弹出表单 - Creating an HTML popup form that is accessible on may websites 异步脚本不可访问 - Asynchronous script not accessible
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM