I was wondering if the statement is true or false just to be sure. I answer similar question online with true, but the correct answer stated the statement is false.
Asked
Active
Viewed 36 times
0
-
1Basically yes if it's inline, or without a `defer` and/or `async` attribute when loading the code from a js file – Alon Eitan Oct 24 '20 at 09:53
-
Javascript will always be executed as soon as it is loaded, often before the DOM is completely ready. This is why in a lot of cases, people add onReady listeners with either jQuery or event listeners for the DOMContentLoaded event – Simen Fjellstad Oct 24 '20 at 09:56