I have some confusion around the new async attribute to the script element in HTML5 that I hope someone can give a clear answer to.
Browsers are capable of Parallel Conn
According to https://www.html5rocks.com/en/tutorials/speed/script-loading/ if a element is added dynamically it may not be executed until
DOMContentLoaded
is fired. That is, some user agents (e.g. MSIE 10) will wait until DOM is ready before running dynamically added elements.
I guess Google wants to get their analytics code running faster on those user agents and as such they need to add async
flag to tell the browser (e.g. MSIE 10) that it's okay to start executing the script as soon as possible. HTML5 compatible browsers would execute as if the async
true even if it was not defined so the async=true
has been added only to improve performance with non-HTML5 browsers.