From what I've read, using "async" in references to external js files, such as:
<script scr="http://someCDN/bla.js" async />
might provide the best performance. However, there also seems to be a potential issue with scripts thus referenced executing in any which order. But for jQuery and jQueryUI (or any jQuery-based js file), you need jQuery to load first, and only thereafter jQueryUI (or fancybox, or goMap, or whatever the case is).
So: Is async a tease, or can it be safely used in such situations (referencing jQuery and its spawn hosted on CDNs)?
You can use async safely with unrelated scripts. But if you need to load them in order (such as your example), you can't just put async on both of them and hope for the best — you'll be creating a race condition.
I found this article on various ways to load scripts quite useful, FWIW.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With