Skip to content

Commit

Permalink
Update script appending .govuk-frontend-supported
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Jul 31, 2023
1 parent aaddb19 commit 522ca3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/get-started/index.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ In your live application, we recommend [using an automated task or your build pi
1. Add the following to the top of the `<body class="govuk-template__body">` section of your page template:

```html
<script>document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');</script>
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
```

2. Copy the `/node-modules/govuk-frontend/dist/govuk/govuk-frontend.min.js` file into your application.
Expand Down
4 changes: 1 addition & 3 deletions source/install-using-precompiled-files/index.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ You’ll not be able to:
<![endif]-->
</head>
<body class="govuk-template__body">
<script>
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
</script>
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
<!-- component HTML -->
<script src="/javascripts/govuk-frontend-<VERSION-NUMBER>.min.js"></script>
<script>
Expand Down

0 comments on commit 522ca3a

Please sign in to comment.