JavaScript: mitigating broken experiences

If JavaScript fails, some tips on how you can ensure users can still complete their task.

Many projects may use solutions (React, Angular or similar) or use Visual Framework components that require JavaScript to function but there are many costs.

Before using a JavaScript-powered solution, the product team should ask themselves:

  1. What are the benefits for the project and user of using a JavaScript solution?
    • Examples: Improved interactivity and state management or specific features.
  2. What are the downsides?
    • Examples: Increased page size, computer requirements, technical complexity, SEO complexity.
  3. What recourse do users have when JavaScript fails, is disabled or an older browser is used?

You should only use JavaScript frameworks when a high level of interactivity is needed and provide robust text or fallback functionality and make use of the JavaScript error template.

Further reading: Gov.uk provides additional reasoning on why you should not assume your JavaScript application works for all users.

Find an issue on this page? Propose a change or discuss it.