Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app = {};
- app.modules = [];
- app.loadScript = function (url, callback) {
- var script = document.createElement("script");
- script.type = "text/javascript";
- if (script.readyState) { //IE
- script.onreadystatechange = function () {
- if (script.readyState == "loaded" ||
- script.readyState == "complete") {
- script.onreadystatechange = null;
- if (callback) {
- callback();
- }
- }
- };
- } else { //Others
- script.onload = function () {
- if (callback) {
- callback();
- }
- };
- }
- script.src = url;
- document.getElementsByTagName("head")[0].appendChild(script);
- };
- app.loadModules = function () {
- var that = this;
- $.each(that.modules, function (key, value) {
- that.loadScript(value);
- });
- };
- app.init = function () {
- var that = this;
- that.loadModules();
- };
- app.modules = [
- '/js/app/admin/forum/list.js'
- ];
- app.init();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement