-
-
Save ericvergnaud/af0a0eddff042cd5f5b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function klass() { | |
return this; | |
} | |
klass.prototype.value = function() { | |
return "OK"; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var klass = require('./klass').klass; | |
module = { | |
"klass" : klass | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var leaf = require('./leaf/module'); | |
module = { | |
"leaf" : leaf | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="lib/require.js"></script> | |
<script> | |
root = require('root/module'); | |
function test() { | |
var k = new root.leaf.klass(); | |
document.write(k.value()); | |
} | |
</script> | |
</head> | |
<body> | |
<script> | |
test(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment