Building a site

How to make a project with Visual Framework components.

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.

Also in this section

More from the Building a site section

Browser support

We focus support on major browsers in use by 95%+ of our audiences, and we ensure the site is navigable and usable by the remaining 5%.

Components are part of patterns

Think of components as lego blocks you can use to build the look and content of your sites. Think of patterns as assembled packages of behaviour.

Content guidelines

Unique to the web are certain types of content that support user interaction.

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