I have read the whole blog, but you have not mentioned how to add a async or defer attrubute to a script tag.. Do we need to add it like this?
<script src="index.js" async ></script> <script src="index.js" async ></script>
or
<script src="index.js" defer></script> <script src="index.js" defer></script>
Hi Rohan, It depends on what you want to achieve.
<body> . . . <script src="index.js" async></script> <script src="script.js" async></script> </body>
<head> . . <script src="index.js" defer></script> <script src="script.js" defer></script> </head>
I hope this clears your doubt now 🙂
ya thankyou sir.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have read the whole blog, but you have not mentioned how to add a async or defer attrubute to a script tag..
Do we need to add it like this?
or
Hi Rohan, It depends on what you want to achieve.
I hope this clears your doubt now 🙂
ya thankyou sir.