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.
[54] |
The term was coined by the authors of the excellent JavaScript Performance Rocks: http://javascriptrocks.com/performance/. |
[55] | |
[56] | |
[57] | |
[58] | |
[59] | |
[60] | |
[61] |
See https://github.com/jquery/jquery/blob/master/src/exports.js#L17. |
18.119.158.74