Skip to content

Commit be9dbd7

Browse files
authored
Fixed typos in defer example
1 parent ac39b06 commit be9dbd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎2-ui/5-loading/02-script-async-defer/article.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ Deferred scripts keep their relative order, just like regular scripts.
7575
So, if we have a long script first, and then a smaller one, then the latter one waits.
7676

7777
```html
78-
<script async src="https://javascript.info/article/script-async-defer/long.js"></script>
79-
<script async src="https://javascript.info/article/script-async-defer/small.js"></script>
78+
<script defer src="https://javascript.info/article/script-async-defer/long.js"></script>
79+
<script defer src="https://javascript.info/article/script-async-defer/small.js"></script>
8080
```
8181

8282
```smart header="The small script downloads first, runs second"
8383
Browsers scan the page for scripts and download them in parallel, to improve performance. So in the example above both scripts download in parallel. The `small.js` probably makes it first.
8484
85-
But the specification requres scripts to execute in the document order, so it waits for `long.js` to execute.
85+
But the specification requires scripts to execute in the document order, so it waits for `long.js` to execute.
8686
```
8787

8888
```smart header="The `defer` attribute is only for external scripts"

0 commit comments

Comments
 (0)