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 (42 loc) 912 B
<!DOCTYPE HTML> <html> <head> <title>curl loading test for &lt;link&gt;ed css</title> <script> curl = { baseUrl: 'support', paths: { curl: '../../src/curl' }, pluginPath: 'curl/plugin', jsPrefetch: true }; </script> <script src="../src/curl.js" type="text/javascript"></script> <script type="text/javascript"> curl( [ 'link!../stuff/base', 'link!../stuff/second', 'domReady!' ] ).then( function (link1, link2) { write('SUCCESS: stylesheets fetched'); }, function (ex) { write('FAILED: ' + ex.message) } ); function write (msg) { curl(['domReady!'], function () { document.body.appendChild(document.createElement('div')).innerHTML = msg; }); } </script> </head> <body> <p>This text should all be the same <span style="color: #00f;">color</span> if the css file loaded.</p> <p>If the second file loaded, these are all caps, too.</p> </body> </html>