title: Uncaught ReferenceError: Backbone is not defined
body: <p>I am building a website with the use of phonegap. I ve noticed that bakcbone and jquery -jqm, don't work in the compiled application. Actually, I am receiving in eclipse the following error:</p>
  
  <blockquote>
    <p>Uncaught ReferenceError: Backbone is not defined at file:///android_asset/www/scripts/JSscript.js:7</p>
  </blockquote>
  
  <p>Also I am receiving the error:</p>
  
  <blockquote>
    <p>Uncaught ReferenceError: requestAnimationFrame is not defined at file:///android_asset/www/scripts/JSscript.js:4484</p>
  </blockquote>
  
  <p>And my touch and click event doesn't function in the extraxted app. Any idea how can I fix this??</p>
  
  <p>JS order:</p>
  
  <pre><code>&lt;script type="text/javascript" src="./scripts/jquery.js"&gt;&lt;/script&gt;
  &lt;script src="http://documentcloud.github.com/underscore/underscore-min.js"&gt;&lt;/script&gt;
  &lt;script src="http://documentcloud.github.com/backbone/backbone-min.js"&gt;&lt;/script&gt;
  &lt;script src='./scripts/JSscript.js'&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And JSscript:</p>
  
  <pre><code>var obj;
  var profile;    
  
  $(function() {
  
      // Backbone model Creation
      var ProfileModel = Backbone.Model.extend({
  
          defaults: {
                  tstamp: 'adffdsa',
                  map:"",
                  tagsCloud:"",
                  sentiment: "",
                  usersCloud: "",
                  timeline: "",
                  highlights: "",
                  signals: ""
          },
  
          initialize: function() {
  
          }
  
      });
  
      //Backbone model initialization
      profile = new ProfileModel({
                  tstamp: 'adffdsa',
                  map:"",
                  tagsCloud:"",
                  sentiment: "",
                  usersCloud: "",
                  timeline: "",
                  highlights: "",
                  signals: ""
      });
  
      var ProfileList = Backbone.Collection.extend({
  
                      model: ProfileModel,
                      url: 'data.php'
      });   
  
      var ProfileView = Backbone.View.extend({
  
          el: "#profiles",
          template: _.template($('#profileTemplate').html()),
          render: function(eventName) {
  
          _.each(this.model.models, function(profile){
          var profileTemplate = this.template(profile.toJSON());
          //push data to obj for map script
          obj = profile.toJSON();
          // Add data to DOM element
          $(this.el).html(profileTemplate);
          }, this);
  
              return this;
  
          }
  
  
      });
  
          var profiles = new ProfileList([profile]);    
          var profilesView = new ProfileView({model: profiles});
  
          // Fetching data from server every n seconds
          setInterval(function() {
  
                  profiles.fetch({reset: true});
  
          }, 4000); // Time in milliseconds
  
           profiles.bind('reset', function () {
  
                  profilesView.render();
  
          });     
  </code></pre>
  
  <p>});</p>