title: Bcakbone.js error in collection fetch
body: <p>I'm trying a simple backbone.js application. And getting error on doing collections fetch and not able to figure out why. Any pointers to check for will be helpful.</p>
  
  <p>1- My backend is java based. </p>
  
  <p>2- here are my model and collection</p>
  
  <pre><code>var lesson = Backbone.Model.extend
  ({
  defaults : 
      {
          lessonId: '',
          lessonName: '',
          subject: '',
          textBook: '',
      },
  
      initialize: function()
      {}
     });
  
  var lessonsCollection = Backbone.Collection.extend
  ({
  model: lesson,
  url: "/lessons?subject=Math&amp;class=5",
  
  initialize : function(){
      //var items = this.fetch();
      //console.log(items);
  }
  
  });
  </code></pre>
  
  <p>3- The response produced from server on the data request is :</p>
  
  <pre><code>[
  {"lessonId":"00000001","lessonName":"DemoFractions","subject":"Math","textBook":"Null"},
  {"lessonId":"00000002","lessonName":"test ","subject":"Math","textBook":"test"}
  ]
  </code></pre>
  
  <p>4- My code to make fetch call looks like</p>
  
  <pre><code>var coll = new lessonsCollection();
  coll.fetch(
          {
          success: function(){
             console.log("got data");
             } ,
  
           error: function(){
             console.log("error in getting data through rest");
             }
          }
      );
  </code></pre>
  
  <p>However everytime the fetch call is resulting in error. What is it that I'm missing in my code?</p>
  
  <p>EDITED: Based on suggestion I'm now logging the response. My code looks like</p>
  
  <pre><code>     coll = new lessonsCollection; 
   coll.fetch(
           {    
                 success: function(){
                       console.log("got data");
                       self.render() ; 
                 } ,
  
         error: function(collection, response){
               console.log("error in getting data through rest");
               console.log("response text got ",response.responseText);
               console.log(response);
             }
           }     
          );  
  </code></pre>
  
  <p>The console log appears like a js code to me. </p>
  
  <p>error in getting data through rest
  response text got<br>
  ({readyState:0, getResponseHeader:(function (e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t}), getAllResponseHeaders:(function (){return 2===b?a:null}), setRequestHeader:(function (e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this}), overrideMimeType:(function (e){return b||(p.mimeType=e),this}), statusCode:(function (e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this}), abort:(function (e){var t=e||w;return u&amp;&amp;u.abort(t),k(0,t),this}), state:(function (){return n}), always:(function (){return i.done(arguments).fail(arguments),this}), then:(function (){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&amp;&amp;e[t];i[o[1]](function(){var e=s&amp;&amp;s.apply(this,arguments);e&amp;&amp;x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):na+"With"})}),e=null}).promise()}), promise:(function (e){return null!=e?x.extend(e,r):r}), pipe:(function (){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&amp;&amp;e[t];i[o[1]](function(){var e=s&amp;&amp;s.apply(this,arguments);e&amp;&amp;x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):na+"With"})}),e=null}).promise()}), done:(function (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&amp;&amp;p.has(n)||l.push(n):n&amp;&amp;n.length&amp;&amp;"string"!==r&amp;&amp;i(n)})})(arguments),n?o=l.length:r&amp;&amp;(s=t,c(r))}return this}), fail:(function (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&amp;&amp;p.has(n)||l.push(n):n&amp;&amp;n.length&amp;&amp;"string"!==r&amp;&amp;i(n)})})(arguments),n?o=l.length:r&amp;&amp;(s=t,c(r))}return this}), progress:(function (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&amp;&amp;p.has(n)||l.push(n):n&amp;&amp;n.length&amp;&amp;"string"!==r&amp;&amp;i(n)})})(arguments),n?o=l.length:r&amp;&amp;(s=t,c(r))}return this}), complete:(function (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&amp;&amp;p.has(n)||l.push(n):n&amp;&amp;n.length&amp;&amp;"string"!==r&amp;&amp;i(n)})})(arguments),n?o=l.length:r&amp;&amp;(s=t,c(r))}return this}), success:(function (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&amp;&amp;p.has(n)||l.push(n):n&amp;&amp;n.length&amp;&amp;"string"!==r&amp;&amp;i(n)})})(arguments),n?o=l.length:r&amp;&amp;(s=t,c(r))}return this}), error:(function (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&amp;&amp;p.has(n)||l.push(n):n&amp;&amp;n.length&amp;&amp;"string"!==r&amp;&amp;i(n)})})(arguments),n?o=l.length:r&amp;&amp;(s=t,c(r))}return this}), responseText:"", status:0, statusText:"error"}) </p>
  
  <p>thanks</p>