So, I was watching a youtube video about how to make a page load faster. Around 1.56 explains that adding async
to a script
tag like so <script src=javascriptfile.js async></script>
does not block rendering and executes only when finishes loading.
Can you give me more information about that async
mark-up, I never see it before. What does it do and how it works? It transforms the whole javascript code contained in that script tags to asynchronous, so obviously it does not block rendering?
What does it mean by "executes only when finishes loading"? The whole html/css page is loaded and then javascript kicks in? But, this synchronous, not asynchrinous, because you have to wait for the whole page to load and then do some other stuff (run javascript)
Please explain.
Thank you