Commit 6b6fd05
committed
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.1 parent 7393225 commit 6b6fd05
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
194 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
195 | 198 | | |
196 | 199 | | |
197 | | - | |
198 | | - | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
0 commit comments