O'Reilly logo

jQuery Design Patterns by Thodoris Greasidis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lazy Loading Modules

Finally, we will get an introduction to the advanced technique of Lazy Loading Modules. The key concept of this practice is that, during the page load, the browser will only download and execute those modules that are required for the initial rendering of the page while the rest of the application modules are requested after the page is fully loaded and is required to respond to a user action. RequireJS (http://requirejs.org/) is a popular JavaScript library that is used as a module loader but, for simple cases, we can achieve the same result with jQuery.

As an example of this, we will use it to lazy load the informationBox module of the Dashboard example that we saw in previous chapters, after the first click of the user on ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required