4 ms·
What you are describing is not lazy-loading. The purpose of lazy loading is to avoid the overhead of having to load all your javascript immediately at the cost
by weixiyen 16y ago
What you are describing is not lazy-loading. The purpose of lazy loading is to avoid the overhead of having to load all your javascript immediately at the cost of more server requests later on as needed.
The benefits of speed gained from lazy-loading can be huge in large applications with little to no browser refresh.
The problem with lazy loading javascript in the browser is you have no good way innate to javascript to automatically tell if a script has really been loaded, and the problem you must solve is finding out when you are allowed to execute commands that have dependencies in the lazy loaded scripts.
- Swizec 16y agoThanks for the explanation, was almost certain I was thinking about it wrong :)