0

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

slevin
  • 4,166
  • 20
  • 69
  • 129
  • read some [documentation](https://developer.mozilla.org/en/docs/Web/HTML/Element/script) first - if you don't understand, then you don't really need to worry about it – Jaromanda X Jan 13 '16 at 22:21
  • Also relevant [Script tag - async and defer](http://stackoverflow.com/questions/10808109/script-tag-async-defer/10808243#10808243). – jfriend00 Jan 13 '16 at 22:23

0 Answers0