Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have actually spent a lot of time struggling with this same exact problem! </p> <p>Here's how I have managed to get it working...</p> <p>First off, download the new sample require-js project with jQuery 1.7. In the zip file you'll find a file called require-jquery.js which includes jQuery 1.7 which is now AMD compliant.</p> <p>Then download the latest version of require, which is now also AMD, and last, try this version of Backbone... </p> <p><a href="https://github.com/jrburke/backbone/blob/optamd/backbone.js" rel="noreferrer">https://github.com/jrburke/backbone/blob/optamd/backbone.js</a></p> <p>Burke has created this off of a fork of backbone and made an AMD compliant version.</p> <p>Then...<br> Index.htm</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Google Analytics API Browser&lt;/title&gt; &lt;!-- This is a special version of jQuery with RequireJS built-in --&gt; &lt;script data-main="main" src="require-jquery.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>main.js </p> <pre><code>require(['jquery','order!libs/underscore-min','order!libs/backbone','order!scripts/app'], function($,_,Backbone,app){ app.init(); }); </code></pre> <p>app.js</p> <pre><code>define(['jquery','backbone','scripts/home'], function($, Backbone, router){ var init = function(){ console.log("Started"); // In here you can load your routers/views/whatever }; return { init: init}; }); </code></pre> <p>My file structure looks like<br> /app/index.htm<br> /app/require-jquery.js<br> /app/order.js<br> /app/main.js<br> /app/text.js<br> /app/scripts/app.js<br> /app/scripts/home.js<br> /app/lib/underscore-min.js<br> /app/lib/backbone.js </p> <p>Let me know if that helps, hit me up on twitter @jcreamer898 if you need some more help, I am literally working on the same stuff!</p> <p><strong>UPDATE</strong> I recently created a Github 2 github projects, one an actual app, and another just a simple starter... </p> <p><a href="https://github.com/jcreamer898/Savefavs" rel="noreferrer">https://github.com/jcreamer898/Savefavs</a><br> <a href="https://github.com/jcreamer898/RequireJS-Backbone-Starter" rel="noreferrer">https://github.com/jcreamer898/RequireJS-Backbone-Starter</a> </p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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