Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I started to think that maybe I wasn't meant to learn Dojo. But, it all comes together with a little more reading. I'm not sure exactly what I did different or whatever, but here's the working layout.</p> <p><em>index.html scripts and config</em></p> <pre><code>&lt;script type="text/javascript"&gt; dojoConfig = { async : true, isDebug : true, debugAtAllCosts : true, packages : [{ name : 'cg', location : '/../js/cg' }] } &lt;/script&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/cg.js"&gt;&lt;/script&gt; </code></pre> <p><em>js/cg.js</em></p> <pre><code>require(['cg/signup', 'dojo/ready'], function(signup){ signup.init('preloader') }) </code></pre> <p><em>js/cg/signup.js</em></p> <pre><code>define(['dojo', 'require'], function(dojo, require){ var fx = require('dojo/_base/fx') return new function(){ this.init = function(id){ fx.fadeOut({node : dojo.byId(id)}).play() } } }) </code></pre> <p>Again, not entirely sure why the <code>var fx = require(...)</code> statement works differently in this one than the others, could be the build I downloaded vs. the CDN, who cares. It works. Some links I used to help for others possibly in the same boat:</p> <p><a href="http://addyosmani.com/writing-modular-js/" rel="nofollow">Writing Modular JS</a></p> <p><a href="https://github.com/jrburke/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define" rel="nofollow">AMD vs CommonJS Wrapper</a></p> <p><a href="http://livedocs.dojotoolkit.org/loader/amd" rel="nofollow">Dojo Toolkit AMD</a></p> <p><a href="http://dojotoolkit.org/documentation/tutorials/1.7/dojo_config/" rel="nofollow">Dojo Config (1.7)</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload