Skip to content

Commit bd23930

Browse files
authored
Update article.md
1 parent 9e99c36 commit bd23930

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Luckily, there are two `<script>` attributes that solve the problem for us: `def
3737

3838
## defer
3939

40-
The `defer` attribute tells the browser not to wait for the script. Instead, the browser will continue to process the HTML, build DOM. The script loads "in the background", and then runs when the DOM is fully built.
40+
The `defer` attribute tells the browser not to wait for the script. Instead, the browser will continue to process the HTML, build DOM. The script loads "in the background", and then runs when the DOM is fully built.
4141

4242
Here's the same example as above, but with `defer`:
4343

@@ -97,13 +97,13 @@ The `async` attribute is somewhat like `defer`. It also makes the script non-blo
9797
9898
The `async` attribute means that a script is completely independent:
9999
100-
- The browser doesn't block on `async` scripts (like `defer`).
101-
- Other scripts don't wait for `async` scripts, and `async` scripts don't wait for them.
100+
- The browser doesn't block on `async` scripts (like `defer`).
101+
- Other scripts don't wait for `async` scripts, and `async` scripts don't wait for them.
102102
- `DOMContentLoaded` and async scripts don't wait for each other:
103103
- `DOMContentLoaded` may happen both before an async script (if an async script finishes loading after the page is complete)
104104
- ...or after an async script (if an async script is short or was in HTTP-cache)
105105
106-
In other words, `async` scripts load in the background and run when ready. The DOM and other scripts don't wait for them, and they don't wait for anything. A fully independent script that runs when loaded. As simple, at it can get, right?
106+
In other words, `async` scripts load in the background and run when ready. The DOM and other scripts don't wait for them, and they don't wait for anything. A fully independent script that runs when loaded. As simple, at it can get, right?
107107
108108
Here's an example similar to what we've seen with `defer`: two scripts `long.js` and `small.js`, but now with `async` instead of `defer`.
109109

0 commit comments

Comments
 (0)