Docs: Fix module links in the package README

The package README used to show examples importing from a regular jQuery file;
this won't work natively. Instead, use module versions of jQuery in these
examples.

Closes gh-5336
This commit is contained in:
Michał Gołębiowski-Owczarek 2023-09-22 01:39:05 +02:00 committed by GitHub
parent a7fa303fda
commit ace646f6e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ or, to use the jQuery ECMAScript module:
```html
<script type="module">
import { $ } from "https://code.jquery.com/jquery-@VERSION.min.js";
import { $ } from "https://code.jquery.com/jquery-@VERSION.module.min.js";
</script>
```
@ -31,7 +31,7 @@ or:
```html
<script type="module">
import { jQuery } from "https://code.jquery.com/jquery-@VERSION.min.js";
import { jQuery } from "https://code.jquery.com/jquery-@VERSION.module.min.js";
</script>
```
@ -39,7 +39,7 @@ All jQuery modules export named `$` & `jQuery` tokens; the further examples will
```html
<script type="module">
import $ from "https://code.jquery.com/jquery-@VERSION.min.js";
import $ from "https://code.jquery.com/jquery-@VERSION.module.min.js";
</script>
```
@ -55,7 +55,7 @@ or as a module:
```html
<script type="module">
import { $ } from "https://code.jquery.com/jquery-@VERSION.slim.min.js";
import { $ } from "https://code.jquery.com/jquery-@VERSION.module.slim.min.js";
</script>
```
@ -67,8 +67,8 @@ To avoid repeating long import paths that change on each jQuery release, you can
<script type="importmap">
{
"imports": {
"jquery": "https://code.jquery.com/jquery-@VERSION.min.js",
"jquery/slim": "https://code.jquery.com/jquery-@VERSION.slim.min.js"
"jquery": "https://code.jquery.com/jquery-@VERSION.module.min.js",
"jquery/slim": "https://code.jquery.com/jquery-@VERSION.module.slim.min.js"
}
}
</script>