JSLazyLoad is a project mainly written in JavaScript, it's free.
On demand lazy loading of JavaScript files.
JavaScript function to load in additional JavaScript files when necessary.
JSLazyLoad allows you to dynamically load in JavaScript files on demand to prevent blocking during initial page load as well as removing clutter from your HTML head.
JSLazyLoad allows you to load in one or multiple JavaScript files at a time, and provides a callback mechanism once the requested files have finished loading.
Load a single JavaScript file, and run the callback when done:
JSLazyLoad('/js/script.js', function()
{
// Add functionality here.
});
Load multiple JavaScript files, and run the callback when all files are finished loading:
JSLazyLoad('/js/script1.js', '/js/script2.js', '/js/script3.js', function()
{
// Add functionality here.
});
JSLazyLoad has been tested and is working on:
Elliott Carlson
trendinteractive (at) gmail (dot) com
https://github.com/elliottcarlson/