Note that there are some explanatory texts on larger screens.

plurals
  1. POBackbone.js fetch unknown error
    primarykey
    data
    text
    <p>I'm facing an issue with my backbone.js app: I'm trying to fetch data from a JSON webservice, the GET HTTP request is successfull (i had a look in the developer console of chrome) but backbone fetch trigger an error and doesn't update the model.</p> <p>You can have a look here to the code: <a href="https://github.com/tdurand/faq-app-client-mobile" rel="nofollow">https://github.com/tdurand/faq-app-client-mobile</a></p> <p>And you can run the app and try to debug here: <a href="http://tdurand.github.com/faq-app-client-mobile/" rel="nofollow">http://tdurand.github.com/faq-app-client-mobile/</a></p> <p>The JSON Feed is like this</p> <pre><code>[ { "title":"Probleme ou Bug", "desc":"Pour les problemes ou les bugs rencontrés", "entries":[ { "title":"testdqs", "desc":"testqsdqs" } ] } ] </code></pre> <p>My collection model is:</p> <pre><code>var Categories = Backbone.Collection.extend({ url:"http://cryptic-eyrie-7716.herokuapp.com/faq/fr", model:Category, parse:function(response) { console.log("test") console.log(response); return response; }, sync: function(method, model, options) { var params = _.extend({ type: 'GET', dataType: 'jsonp', url: model.url, processData:false }, options); return $.ajax(params); }, </code></pre> <p>});</p> <p>And my view:</p> <pre><code>var IndexView = Backbone.View.extend({ el: '#index', initialize:function() { Categories.fetch({ success: function(m,r){ console.log("success"); console.log(r); // =&gt; 2 (collection have been populated) }, error: function(m,r) { console.log("error"); console.log(r.responseText); } }); Categories.on( 'all', this.render, this ); }, //render the content into div of view render: function(){ //this.el is the root element of Backbone.View. By default, it is a div. //$el is cached jQuery object for the view's element. //append the compiled template into view div container this.$el.html(_.template(indexViewTemplate,{categories:Categories})); //Trigger jquerymobile rendering $("#index").trigger('pagecreate'); //return to enable chained calls return this; } }); return IndexView; </code></pre> <p>Thanks a lot for your help</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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