diff --git a/CHANGELOG.md b/CHANGELOG.md index c4c2def14d..32a38be01e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,22 @@ However, because these polyfills create or extend global objects ('polluting the These changes were introduced in [pull request #1326: Remove IE11 vendor polyfills](https://github.com/nhsuk-frontend/pull/1326). +#### Stop Internet Explorer 11 and other older browsers running unsupported JavaScript + +Add `type="module"` to all HTML ` + {% endblock %} {# Turn the header and footer off #} diff --git a/docs/installation/installing-compiled.md b/docs/installation/installing-compiled.md index a01757abac..875f57b1e6 100644 --- a/docs/installation/installing-compiled.md +++ b/docs/installation/installing-compiled.md @@ -29,7 +29,7 @@ If you require any of this functionality, you should [install using npm](/docs/i - + diff --git a/docs/installation/installing-with-npm.md b/docs/installation/installing-with-npm.md index 4ac4b42d19..4ffcfb74b7 100644 --- a/docs/installation/installing-with-npm.md +++ b/docs/installation/installing-with-npm.md @@ -79,19 +79,19 @@ document.body.className = ((document.body.className) ? document.body.className + ### Option 1: Include compiled JavaScript -Include the `node_modules/nhsuk-frontend/dist/nhsuk.min.js` script in the `` of your page using the `defer` attribute. +Include the `node_modules/nhsuk-frontend/dist/nhsuk.min.js` script in the `` of your page using the `type="module"` attribute. -> The defer attribute is used for performance benefits as the browser loads the JavaScript file as soon as possible, due to it being in the ``, but will not run until after the page has loaded. +> The `type="module"` attribute stops Internet Explorer 11 and other older browsers running the JavaScript, which relies on features older browsers might not support and could cause errors. The script will be loaded as soon as possible, due to it being in the ``, but will not run until after the page has loaded. You might wish to copy the file into your project or reference it straight from node_modules. ```html - + ``` ```html - + ```