title: Using jQuery.load with RequireJS
body: <p>I often bootstrap widgets I write like so:</p>
  
  <pre><code>$(window).load(function () {
    doStuff();
  });
  </code></pre>
  
  <p>This is often the case as I write widgets that are dependent on the rest of the application to be initialized.</p>
  
  <p>I recently started using RequireJS and am not able to figure out how to attach a callback as in the code above.  I looked at and tried the domReady plugin however, it won't fit my use-case since the callbacks are invoked when the DOM is ready and not when all resources are loaded.</p>
  
  <p>Here is what I have tried so far:</p>
  
  <pre><code>// Using domReady (main.js):
  require(['require', 'domReady'], function (require, domReady) {
      'use strict';
  
      domReady(function () {
          require(['app'], function (App) {
              console.log(window);
              App.initialize();
          });
      });
  });
  
  // Using jQuery (main.js)
  // Note, this does not work.
  require(['jquery', 'app'], function ($, App) {
      'use strict';
  
      $(window).load(function () {
          App.initialize();
      });
  });
  </code></pre>
  
  <p>Given the above, what is the correct way to achieve using <code>$(window).load()</code> with RequireJS?</p>