Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Degrade gracefully when external JS can’t be loaded
There are plenty of situations where external JS could fail to load and be unavailable. For performance reasons we apply the js-enabled class inline, which can lead to a mismatch between the JS availability and the styling hook. To work around this, we can check at the end of the document to see whether GOVUK (our standard module namespace) exists. If not then the external JS hasn’t triggered: at this point we can remove the js-enabled class from the body and fall back to the non-JS styling.
- Loading branch information