What We’ve Learned

You can make your site much snappier by asynchronously loading the scripts you don’t need right away. The easiest way to do that is with judicious use of the defer and async attributes. If you need to load scripts conditionally, consider a loader like yepnope. And if your site has scores of interdependent scripts, take a good look at Require.js. Choose the right tool for the job, embrace it, and enjoy.

And on that note, we’ve reached the end of the book. Thanks for taking the time to read it. It was my pleasure to write it. No matter where your JavaScript journey takes you from here, I hope that it’s rich in beautiful, event-driven code.

Footnotes

[54]

The term was coined by the authors of the excellent JavaScript ...

Get Async JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.