Accessibility widget script

Required level of JavaScript Knowledge

To configure and implement the WCAG accessibility widget as a standard script, basic JavaScript knowledge is sufficient, including:

  • Adding scripts to web pages.
  • Creating and modifying JavaScript objects.
  • Passing arguments to functions.

No advanced programming knowledge is required – the script is designed to be easy to integrate even into simple HTML pages without frameworks.

However, if you are using modern frontend technologies such as npm, React, Vue, or Svelte, we recommend installing the widget via dedicated packages:

These methods offer additional conveniences such as hooks, providers, reactive mechanisms, and better integration with SPA applications.


Script Structure and Operation

Basic Script Framework:


<script>
    (function (d, s, t) {
        var f = d.getElementsByTagName(s)[0],
            j = d.createElement(s);
        j.async = true;
        j.src = '//wcag.dock.codes/accessibility/' + t + '/start.js';
        f.parentNode.insertBefore(j, f);
    })(document, 'script', '_TOKEN_');
</script>

Script Parameters:

  1. '_TOKEN_'

    • Description: A unique token assigned to your widget.
    • Required: Yes.
    • You can download the token for free in your DockWCAG account.
    • Example: 'abcde12345'.

Final Notes

  • Before implementing, make sure your token is valid and active.
  • If the widget doesn’t display after adding the script, check your browser console (F12 → “Console”).
  • If you continue to have problems, visit the Troubleshooting section 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.