title: Dynamically add widgets to a dashboard using backbone.js and jquery
body: <p>I'm coding a Dashboard of a Web-CMS app using Backbone.js and several jQuery plugins.
  This dashboard should be as intuitive and customizable as possible and highly extendable at once.</p>
  
  <p>Now, what I want to do, is to load a widget's data and it's template by an api via ajax.
  In fact, that isn't a problem but I wanted to ask you about a best practice to load template data (HTML/javascript/etc...) with javascript via ajax.</p>
  
  <p>I could make multiple ajax calls where I first receive an html snippet with the template and then load it's data in a second request as a JSON string.</p>
  
  <pre><code>// first request
  &lt;h6&gt;Some HTML Stuff here&lt;/h6&gt;
  // second request
  {"id": "5", "name": "Example Widget"}
  </code></pre>
  
  <p>Or I could store the template itself in a JSON string which on the other side would reduce server-load but feels kind of wrong.</p>
  
  <pre><code>// single request
  {"id": "5", "name": "Example Widget", "template": "&lt;h6&gt;Some HTML stuff here"&lt;/h6&gt;"}
  </code></pre>
  
  <p>Any suggestions or other methods?</p>