Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 ?



There 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.


But there is, it's called defer?!


You 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: