Skip to content

Commit

Permalink
Add defer to module/nomodule loading example
Browse files Browse the repository at this point in the history
  • Loading branch information
carhartl committed Sep 12, 2019
1 parent 87ee3e9 commit 7207115
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -48,11 +48,12 @@ Example:

_Not all browsers support ES modules natively yet_. For this reason the npm package/release
comes with both an ES module as well as an UMD module variant. Include the module along
with the fallback to account for this:
with the fallback to account for this. You may want to load the nomodule script in a deferred
fashion (modules are deferred by default):

```html
<script type="module" src="/path/to/js.cookie.mjs"></script>
<script nomodule src="/path/to/js.cookie.js"></script>
<script nomodule defer src="/path/to/js.cookie.js"></script>
```

Note the different extensions: `.mjs` denotes an ES module.
Expand Down

0 comments on commit 7207115

Please sign in to comment.