-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revise <script>
elements to use defer
loading
#43
Comments
<script>
elements to user defer
loading<script>
elements to use defer
loading
Need to check how the use of For e.g., the following code is included towards the end of the body of <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js" integrity="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg=" crossorigin="anonymous"></script>
<script>anchors.add();</script> If <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js" integrity="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg=" crossorigin="anonymous"></script> is moved to the head section and set to defer loading, will the <script>anchors.add();</script> line still work if left at the bottom of the body, or will it need moving into a script that triggers when the document has loaded? |
Another question is whether <script>anchors.add();</script> I.e. is the following valid?: <script defer>anchors.add();</script> |
The answer is no,
|
To get round this possible problem is to create a JavaScript file that loads last that calls code like anchors.add(); |
Pull all
<script>
elements into document<head>
and adddefer
attribute to them to improve script loading characteristics.The text was updated successfully, but these errors were encountered: