Describe the difference between <script>, <script async> and <script defer>.

  • <script> - HTML parsing is blocked, the script is fetched and executed immediately, HTML parsing resumes after the script is executed.
     
  • <script async> - The script will be fetched in parallel to HTML parsing and executed as soon as it is available (potentially before HTML parsing completes).

    Use async when the script is independent of any other scripts on the page, for example, analytics.
Describe the difference between <script> , <script async> and <script defer> . <script> - HTML parsing is blocked, the script is fetched and executed immediately, HTML parsing resumes after the script is executed. <script async> - The script will be fetched in parallel to HTML parsing and executed as soon as it is available (potentially before HTML parsing completes). Use async when the script is independent of any other scripts on the page, for example, analytics.

Describe the difference between <script>, <script async> and <script defer>.

By Code 100mph

Describe the difference between <script>, <script async> and <script defer>.

  • 221