Tutorial Async Script Loader with Callback

var Loader = function () { } Loader.prototype = { require: function (scripts, callback) { this.loadCount = 0; this....

var Loader = function () { }
Loader.prototype = {
require: function (scripts, callback) {
this.loadCount = 0;
this.totalRequired = scripts.length;
this.callback = callback;

for (var i = 0; i < scripts.length; i++) {
this.writeScript(scripts[i]);
}
},
loaded: function (evt) {
this.loadCount++;

Hot in Week

Popular

Archive

item