title: Using BackboneJs with jQuery Deferreds
body: <p>I am using a technique I read about from <a href="http://quickleft.com/blog/leveraging-deferreds-in-backbone-js" rel="nofollow">Sam Breed</a> for using Deferreds inside of Backbone.</p>
  
  <p>Inside my <code>initialize</code> method of my Backbone <code>View</code> I have the following:</p>
  
  <pre><code>var me = this;
  
  this.deferredTemplate = $.ajax({
      url: 'details/welcomeMaster.htm'
  }).done(function (data) {
      me.template = data;
  });
  </code></pre>
  
  <p>This will load a template file for me that is located externally to my <code>View</code>.</p>
  
  <p>Then when I need it here is the code to new it up.</p>
  
  <pre><code>var something = new Dashboard.Views.WelcomeMasterView({
          collection: me.collection,
          el: $('.contentContainer')
  });
  
  something.deferredTemplate.done(function (data) {
          something.render();
  });
  </code></pre>
  
  <p>Unfortunately I have to break up those 2 statements so that <code>something</code> is my Backbone <code>View</code> and not the jqXHR object. Other than that this code works just fine.</p>
  
  <p><strong>Question</strong>
  Any ideas on how to chain together the 2 calls above? Inside the <code>.done()</code> method I need the Backbone <code>View</code> object.</p>