7 ms·
I like Dojo/AMD because when you specify dependencies, you implicitly give an execution order. Now, that doesn't necessarily help for this kind of "top level"
by Terr_ 13y ago
I like Dojo/AMD because when you specify dependencies, you implicitly give an execution order.
Now, that doesn't necessarily help for this kind of "top level" code, but wouldn't it be cool if you could say: "Load this <script> tag asynchronously, but only run it once the following other <script> tags finish"? (You can give <script> tags HTML IDs just like anything else, right?)
- andrewmunsell 13y agoYou can kind of do that-- the defer attribute of the script tag behaves similarly to async in that the scripts can be downloaded without blocking, but they are supposed execute in the order that they are included in the page (unlike async). http://stackoverflow.com/a/10731231/480033 http://stackoverflow.com/a/10731231/480033 However, browser implementation isn't consistent so there's no guarantees really.