var require_modules function require name require_modules name var mod

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
var require_modules = {};
........
function require(name) {
require_modules[name] = 1;
}
...........
var modules = {
likes: {
scripts: ["Likes.js"],
init: function() { Likes.init(); },
},
};
$(function () {
for (var module in require_modules) {
Loader.load(modules[module].scripts, modules[module].init);
}
})