pablomoretti / jcors-loader

Little tiny loader for javascript sources using CORS
23 stars 10 forks source link

jcors-loader (v.1.2.0)

Little tiny loader for javascript sources using CORS (only 1.2KB plane and 673 with Gzip)

Goals

* The script works fine in IE 6/7 but blocks onload and sources not load in parallel.

http://jcors-loader.herokuapp.com/test/

Really easy to use

* How enable CORS ?

Example "One source with one callback"

JcorsLoader.load(
        "http://xxxx/jquery.min.js", 
        function() {
                $("#demo").html("jQuery Loaded");
        }
        );

Example "Multiple sources with multiple callbacks"

JcorsLoader.load(
            "http://xxxx/jquery.min.js",
            function() {
                $("#demo").html("jQuery Loaded");
            },
            "http://xxxx/jquery.cookie.js",
            function() {  
                $.cookie('not_existing'); 
            }
            );

Test

require : node.js

Build

require : java

How do I contribute ?

That is great! Just fork the project in github. Create a topic branch, write some code and send a pull request.

jcors-loader is licensed under the Apache Licence, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)