title: Uncaught ReferenceError: Backbone is not defined
body: <p>I am completely new to Backbone JS. I thought I could solve this minor problem by myself but I can't figure why I am still getting this error:</p>
  
  <blockquote>
    <p>Uncaught ReferenceError: Backbone is not defined </p>
  </blockquote>
  
  <p>when trying to extend a Backbone.Model. <code>backbone.js</code> is called before the script that uses it so I don't get it.</p>
  
  <h2>index.html</h2>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8"/&gt;
          &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="js/backbone.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="js/main.js"&gt;&lt;/script&gt;
          &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h2>My external file main.js</h2>
  
  <pre><code>(function($) {
      window.Doc = Backbone.Model.extend({
          defaults : {
              id : '???',
              title : 'Le titre de mon modèle',
              text : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer varius ipsum nec porta dignissim. Donec a elementum magna. Donec sagittis magna eu nulla ullamcorper dictum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nullam volutpat felis vehicula, congue mi at, lobortis dolor.',
              keywords : 'lorem ipsum dolor sit amet'
          },
          initialize : function Doc() {
              console.log('Doc Constructor');
          }
      });
  })(jQuery);
  </code></pre>
  
  <p>I also get the following error coming from backbone.js:219</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot call method 'each' of undefined</p>
  </blockquote>