Deferred attribute order
From the book:
"The HTML5 specification indicates that scripts will be executed in the order in which they appear, so the first deferred script executes before the second deferred script, and both will execute before the DOMContentLoaded event (see Chapter 13 for more information). In reality, though, deferred scripts donât always execute in order or before the DOMContentLoaded event, so itâs best to include just one when possible."
So... will the first deferred script executes before, or after the second deferred script?
What situations could lead to the second deferred script get executed before the first deferred script ?
Is there a way to be completely sure that the scripts will run in the same order as they appear then?
Thank you!
|