Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ec8c7e4b7a
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (38 sloc) 1.349 kb
<!DOCTYPE HTML>
<html>
<head>
<title>CommonJS Modules 1.1 loading test</title>
<script>
curl = {
paths: {
curl: '../src/curl',
commonjs: 'support/commonjs'
}
};
</script>
<script src="../src/curl.js" type="text/javascript"></script>
<script type="text/javascript">
curl(
[
// test modules:
'commonjs/exports',
'commonjs/this',
'commonjs/hybrid',
'domReady!'
]
).then(
function (exports, thisModule, hybrid) {
document.body.appendChild(document.createTextNode('A module that exports properties loaded successfully if "it works" == ' + exports.testMessage + '.'));
document.body.appendChild(document.createElement('br'));
document.body.appendChild(document.createTextNode('A module that exports as `this` loaded successfully if "it works" == ' + thisModule.testMessage + '.'));
document.body.appendChild(document.createElement('br'));
document.body.appendChild(document.createTextNode('A module that inspects `require("module")` loaded successfully if "commonjs/module" == ' + hybrid.foo.testMessage + '.'));
document.body.appendChild(document.createElement('br'));
document.body.appendChild(document.createTextNode('A module that exposes its module info loaded successfully if this "commonjs/this" == ' + thisModule._module.id + '.'));
}
);
</script>
</head>
<body>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.