-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit d803b54
docs: update example <script> loading strategy (#7663)
* docs: update example <script> loading strategy
In the code examples, a <script> tag is
placed just before the ending </body> tag.
This causes the script's external resource to
download and execute only after the HTML has been
parsed up to that point.
For organization and faster script evaluation,
we can consolidate scripts in the <head>
and enable their defer attribute, which will
download the external resource in parallel with
HTML parsing. Once the HTML is parsed, the
deferred script will execute.
* docs: provide tip instead of rewriting examples
* docs: update wording, add link to additional info
---------
Co-authored-by: Zowie Beha <113861530+1zzowiebeha@users.noreply.github.com>1 parent fd94d2a commit d803b54
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | + | ||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
204 | + | ||
205 | + | ||
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
| |||
0 commit comments