Importing scripts and libraries
While the web workers is not ready in cross-browsers, we can implement our own importScripts() function to do it until the browsers adds its support.
if ("undefined" === typeof importScripts) { function importScripts() { if (arguments.length <= 0) { return; } var args = Array.prototype.slice.apply(arguments); window.onload = function () { while (scriptName = args.shift()) { var script = document.createElement("script"); document.getElementsByTagName("head")[0].appendChild(script); } }; } } importScripts( "assets/js/app/vendor/jquery/jquery-1.10.1.min.js", "assets/js/app/vendor/lazyload/lazyload.min.js" );
Here, we have an example using the libraries: assets/js/app/vendor/jquery/jquery-1.10.1.min.js assets/js/app/vendor/lazyload/lazyload.min.js







