title: How to define received datatype, in backbone.js fetch()?
body: <p>fetch data from server returns me json data as a <strong>string</strong> datatype rather than as <strong>application/json</strong> datatype, as a result the collection does not get refreshed.</p>
  
  <p>I have tried giving the jquery.ajax option <strong>contentType:"application/json"</strong> to the fetch options, but still does not work.</p>
  
  <p>how can i make it work? do i send a mimetype from the server? if so, how?</p>
  
  <p>i am using json_encode on the data sent.</p>
  
  <pre><code>preloader.fetch({
          contentType:'application/json'
      });
  </code></pre>
  
  <p>preloader is an instance of my collection.</p>
  
  <p><strong>edit:</strong>
  my template for a subview was not getting detected as i had kept it out of the masterview's <strong>$el</strong> element, corrected it, and now i am getting underscore.js error, that </p>
  
  <p><strong>str is null in</strong> </p>
  
  <pre><code>str.replace(/\\/g, '\\\\')     //at line 913
  </code></pre>
  
  <p>is this because the backbone app is not taking it as a json object?</p>
  
  <p><strong>Request headers</strong></p>
  
  <pre><code>Connection  close
  Content-Type    text/html
  Date    Thu, 12 Apr 2012 13:00:58 GMT
  Server  Apache
  Transfer-Encoding   chunked
  Vary    Accept-Encoding
  </code></pre>
  
  <p><strong>Response headers</strong>
  has the line</p>
  
  <pre><code>Accept  application/json, text/javascript, */*; q=0.01
  </code></pre>
  
  <p>means it is a json, then what is the problem?</p>