Skip to content

Module to support lazy loading of JavaScript and CSS resources

Notifications You must be signed in to change notification settings

lasso-js/lasso-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lasso-loader

This module provides functionality to asynchronously load JavaScript and CSS resources in any web browser. It's used by Lasso.js to support lazily loading resources, but it can also be used independently of Lasso.js.

NOTE: All resources are loaded in parallel.

Usage

var lassoLoader = require('lasso-loader');

lassoLoader.load({
        js: [
            'http://foo.com/static/foo.js',
            'http://foo.com/static/bar.js'
        ],
        css: [
            'http://foo.com/static/foo.css',
            'http://foo.com/static/bar.css'
        ]
    },
    function(err) {
        if (err) {
            // Something went wrong
        } else {
            // All resources successfully loaded!
        }
    });

About

Module to support lazy loading of JavaScript and CSS resources

Resources

Stars

Watchers

Forks

Packages

No packages published