Update script tag with defer

- Adding `defer` boolean attribute to the script tag. Without `defer` the script will block DOM parsing/rendering which slows down the page
- Added a comment to the script tag: Has to be used with caution because it also blocks DOM rendering
This commit is contained in:
benunternaehrer 2017-12-20 22:41:39 +01:00 committed by GitHub
parent 0f69eef226
commit 5d3bdd30db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -82,11 +82,13 @@ Valid `<head>` elements include `meta`, `link`, `title`, `style`, `script`, `nos
/* ... */
</style>
<!-- JavaScript & No-JavaScript tags -->
<script src="script.js"></script>
<!-- JavaScript files -->
<script src="script.js" defer></script>
<!-- Inline JavaScript (attention: causes render blocking) -->
<script>
// function(s) go here
</script>
<!-- No-JavaScript tag -->
<noscript>
<!-- No JS alternative -->
</noscript>