Skip to content

Commit

Permalink
Show .govuk-frontend-supported snippet in example
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Dec 8, 2023
1 parent 8fe6dc2 commit 21be7b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/importing-css-assets-and-javascript/index.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ Then import the JavaScript file before the closing `</body>` tag of your HTML pa

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

<!-- // ... -->

<script type="module" src="<YOUR-JAVASCRIPTS-FOLDER>/govuk-frontend.min.js"></script>
<script type="module">
import { initAll } from '<YOUR-JAVASCRIPTS-FOLDER>/govuk-frontend.min.js'
Expand Down

0 comments on commit 21be7b3

Please sign in to comment.