7 ms·
That's something that really astounds me with this async thing. Why on earth when they introduced it they didn't add a way to tell the browser the order of exe
by Xoros 9y ago
That's something that really astounds me with this async thing.
Why on earth when they introduced it they didn't add a way to tell the browser the order of execution ? Or may be it exists and I haven't heard about it ?
- ko27 9y agoThere is a way: ES6 modules. If you can account for the order of execution (with modules or custom loaders) async is, in almost all cases, the best way to load your scripts. Defer (or body-end) scripts also specify the execution order, but only in a strictly linear fashion which usually has a performance hit.
- cisanti 9y agoBut there is, it's called defer?!
- codedokode 9y agoYou also need to hide JS controls before the scripts are loaded or you will get "dead" buttons that are visible but don't react to clicks.