Re:LoadJS – A tiny async loader for modern browsers (710 bytes)
by helb on Wednesday December 14, 2016 @06:48AM
(#13175303)
Maybe, but you can make it better even without any fancy loaders, async and defer are regular attributes of the script tag – https://developer.mozilla.org/en/docs/Web/HTML/Element/scrip...
[ Parent
| on HN ]
Re:LoadJS – A tiny async loader for modern browsers (710 bytes)
by Flimm on Wednesday December 14, 2016 @08:17AM
(#13175708)
`defer` has problems: http://stackoverflow.com/a/40535440/247696
There is no obvious easy way to wait for an `async` script to finish loading and executing before running code that depends on it. For instance, how would I load the jQuery library asynchronously before running code that depends on jQuery?