Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Degrade gracefully when external JS can’t be loaded #248

Merged
merged 1 commit into from
Sep 12, 2016

Commits on Sep 12, 2016

  1. 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.
    Robin Whittleton committed Sep 12, 2016
    Configuration menu
    Copy the full SHA
    4b0afef View commit details
    Browse the repository at this point in the history