async vs defer attributes - Growing with the Web
When should I use what?
Fri 17 Jul 2015 04:47:22 PM CEST - permalink -
Typically you want to use async where possible, then defer then no attribute. Here are some general rules to follow:
If the script is modular and does not rely on any scripts then use async.
If the script relies upon or is relied upon by another script then use defer.
If the script is small and is relied upon by an async script then use an inline script with no attributes placed above the async scripts.
Pratique pour bien saisir la différence