I am trying to make my site accessibility compatible.
I am using achecker.ca to see my errors.
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.
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:
Short Description
This error will be generated for allscriptelements.
and then they have two examples, one passing, one failing.
Pass Examples
Does not contain ascriptelement.
Fail Examples
Contains ascriptelement.
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>).
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. But flagging a script generically does not mean anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With