Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (35 sloc) 961 Bytes
<!doctype html>
<html>
<body>
<h1>Module Server Demo</h1>
<p id="help">Make sure to start <code>node demo-server.js</code> and then just open this
file in your web browser</p>
<pre id="log"></pre>
<button onclick="loadMoreCode()">Load more code</button>
<script src="../third-party/LABjs/LAB.src.js"></script>
<script src="../module-client.js"></script>
<script>
window.loadModule = ModuleServer('http://127.0.0.1:1337/');
root = {};
loadModule('module/foo', function() {
log('loaded module/foo');
document.getElementById('help').style.display = 'none';
loadModule('app', function() {
log('loaded app');
});
});
loadModule('module/baz/foo', function(foo) {
log('loaded module/baz/foo ');
log('Call loaded function: ' + foo.foo());
});
function log(msg) {
document.getElementById('log').textContent += msg + '\n';
}
function loadMoreCode() {
loadModule('sub_app', function(app) {
app.testLoad()
});
}
</script>
</body>
</html>
Something went wrong with that request. Please try again.