title: Uncaught TypeError: Cannot read property 'localStorage' of undefined
body: <p>I have the following in the backbonejs app:</p>
  
  <pre><code>////MODEL
  var app={};
  app.ledger=Backbone.Model.extend();
  
  ////COLLECTION
  app.ledgerList=Backbone.Collection.extend({
  model: app.ledger,
  localStorage:new Store('ledgerstore')
   });
  
  ////INITIATING COLLECTION
  app.ledgerlist=new app.ledgerList();
  </code></pre>
  
  <p>In one of my views i try to create a new model in the collection like this:</p>
  
  <pre><code>newAttributes:function(){
      return{
          name:$("#ledgerName").val(),
          email: $("#ledgerEmail").val(),
          address: $("#ledgerAddress").val(),
          phone: $("#ledgerPhone").val()
  
       }},
  saveLedger: function(){
      app.ledgerlist.create(this.newAttributes());
  
  
  }
  </code></pre>
  
  <p>I get the error <code>Uncaught TypeError: Cannot read property 'localStorage' of undefined</code> on the line <code>app.ledgerlist.create(this.newAttributes());</code></p>
  
  <p>It all started occuring suddenly out of nowhere. It was working a few mins back. I guess it has to do something with localstorage. I cleared it but still the same. In firefox console says d.collection is undefined.</p>
  
  <p>Please guide.</p>