Accessibility widget script
Required Level of JavaScript Knowledge
To configure and implement the WCAG accessibility script, basic knowledge of JavaScript is sufficient, including:
- Adding scripts to web pages.
- Creating and modifying JavaScript objects.
- Passing arguments to functions.
Advanced programming knowledge is not required – the script is designed to be easy to use for non-experts in coding.
Script Structure and Operation
Basic Script Skeleton:
<script> (function (d, s, t) { var f = d.getElementsByTagName(s)[0], j = d.createElement(s), a = new Date().getTime(); j.async = true; j.src = '//wcag.dock.codes/accessibility/' + t + '/start.js?t=' + a; f.parentNode.insertBefore(j, f); })(document, 'script', '_TOKEN_'); </script>
Script Parameters:
'_TOKEN_'
- Description: A unique token that you can generate for free on your DockWCAG account.
- Required: Yes.
- Example:
'abcde12345'
.
Concluding remarks
- Make sure your unique token is correct before deployment.
- If after inserting the script with the correct code the widget does not display, check for errors in the browser console (F12 “console” tab).
- In case of further problems, check the Troubleshooting section in our documentation or contact us.