Skip to content

Commit d01b9e3

Browse files
notriddlesyphar
authored andcommitted
Optimize loading docs.rs-specific javascript
This removes the [type] attribute, which is not recommended by MDN since JavaScript is the default anyway, and loads it [async] instead of blocking. [type]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type [async]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-async
1 parent eaa5b49 commit d01b9e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/rustdoc/body.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script type="text/javascript" src="/-/static/menu.js?{{ docsrs_version() | slugify }}"></script>
2-
<script type="text/javascript" src="/-/static/index.js?{{ docsrs_version() | slugify }}"></script>
1+
<script async src="/-/static/menu.js?{{ docsrs_version() | slugify }}"></script>
2+
<script async src="/-/static/index.js?{{ docsrs_version() | slugify }}"></script>
33
{# see comment in ../storage-change-detection.html for details #}
44
<iframe loading="lazy" src="/-/storage-change-detection.html" width="0" height="0" style="display: none"></iframe>

0 commit comments

Comments
 (0)