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:

  1. '_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.
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.