Question

I have this simple JSON feed which I am attempting to read in a BackBone.JS app.

My challenge is the network traffic comes up completely blank as illustrated below:

enter image description here Using the following code:

 //Collections
  var Topics = Backbone.Collection.extend({
      model: TopicStruct,

      initialize: function(){
          console.log('Collector Responding!');
      },

      url: 'http://dev-sw-budget.gotpantheon.com/sort-coordinator-json',

      render: function(){
          console.log('Topics Render Responding!');
      },

  });

Why am I not getting my data in my Backbone app?

UPDATE:

My fetching code:

$(document).ready(
      function(){
          console.log('--- DOM Ready!');
          var topics = new Topics();
          var topicsView = new TopicsList({collection: topics});
          topics.fetch({reset: true});

          $('#data table').append(topicsView.el);
      }
  );
Was it helpful?

Solution

I think the problem it's that you are not calling fetch() in your collection. I have put your code together in a JSFiddle and it works.

var topics = new Topics();
topics.fetch();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top