Kevin Powell - CommunityKP-C
Kevin Powell - Communityโ€ข4mo agoโ€ข
6 replies
Faker

defer vs async keyword in script tags

Hello, quick question, I know that both defer and async will load our external javascript file at the same time as our HTML parser is working. The difference is that defer will only be "triggered" after the HTML parser has been completed.

On the other hand, the async keyword would mean that "run the external file whether or not the HTML parser has completed".

I always make use of the defer keyword, so I wanted to know some use cases where async is used, any idea please.
Was this page helpful?