Sha256: 38bb8720caca9d58f0ac6cdec55f11f5859f43c4cba7a37bdf9f6991de7a5a0f
Contents?: true
Size: 1.81 KB
Versions: 2
Compression:
Stored size: 1.81 KB
Contents
<!DOCTYPE html> <html> <head> <title>require.js: paths Test</title> <script type="text/javascript"> requirejsArgs= { dojoLocation:"../../../../.." }; </script> <script type="text/javascript" src="../requirejs-setup.js"></script> <script type="text/javascript" src="../../../../../dojo.js"></script> <script type="text/javascript"> var globalCounter = 0, scriptCounter = 0; require({ baseUrl: "./", packages: [ { name:"first", location:"first.js", main:"./first" } ] }, ["require", "first!whatever", "doh"], function(require, first, doh) { doh.register( "paths", [ function paths(t){ //First confirm there is only one script tag for each //module: var scripts = document.getElementsByTagName("script"), i, counts = {}, modName, props, something; for (var i = scripts.length - 1; i > -1; i--) { modName = scripts[i].getAttribute("src"); if (/first\.js$/.test(modName)) { scriptCounter += 1; } } if(require.async){ t.is(1, scriptCounter); } t.is(2, globalCounter); t.is("first", first.name); t.is("second", first.secondName); } ] ); doh.run(); } ); </script> </head> <body> <h1>require.js: paths Test</h1> <p>Check console for messages</p> </body> </html>
Version data entries
2 entries across 2 versions & 1 rubygems