UNPKG

curl-amd

Version:

curl.js is small, fast, extensible module loader that handles AMD, CommonJS Modules/1.1, CSS, HTML/text, and legacy scripts.

54 lines (45 loc) 941 B
<!DOCTYPE HTML> <html> <head> <title>underscore test file</title> <script> curl = { baseUrl: '', paths: { curl: '../src/curl', underscore: 'support/underscore-amdjs-1.3.1/underscore' }, preloads: [ ] }; </script> <script src="../src/curl.js" type="text/javascript"></script> <script type="text/javascript"> curl( ['underscore'], // load something or callback will execute asap function (_) { try { // test for one of underscore's last methods if (typeof _.chain == 'function') write('SUCCESS: underscore loaded'); else write('FAILED: underscore not fully loaded'); } catch (ex) { write('FAILED: ' + ex.message); } }, function (ex) { write('ERROR: ' + ex.message); } ); function write (msg) { curl('domReady!', function () { document.body.appendChild(document.createElement('div')).innerHTML = msg; }); } </script> </head> <body> </body> </html>