Update article.md
This commit is contained in:
parent
5189d51cd7
commit
02e82ad409
1 changed files with 1 additions and 1 deletions
|
@ -185,7 +185,7 @@ But there are also essential differences between them:
|
||||||
|
|
||||||
| | Order | `DOMContentLoaded` |
|
| | Order | `DOMContentLoaded` |
|
||||||
|---------|---------|---------|
|
|---------|---------|---------|
|
||||||
| `async` | *Load-first order*. Their document order doesn't matter -- which loads first | Irrelevant. May load and execute while the document has not yet been fully downloaded. That happens if scripts are small or cached, and the document is long enough. |
|
| `async` | *Load-first order*. Their document order doesn't matter -- which loads first runs first | Irrelevant. May load and execute while the document has not yet been fully downloaded. That happens if scripts are small or cached, and the document is long enough. |
|
||||||
| `defer` | *Document order* (as they go in the document). | Execute after the document is loaded and parsed (they wait if needed), right before `DOMContentLoaded`. |
|
| `defer` | *Document order* (as they go in the document). | Execute after the document is loaded and parsed (they wait if needed), right before `DOMContentLoaded`. |
|
||||||
|
|
||||||
In practice, `defer` is used for scripts that need the whole DOM and/or their relative execution order is important.
|
In practice, `defer` is used for scripts that need the whole DOM and/or their relative execution order is important.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue