title: Launching Bootstrap modal with Backbone
body: <p>Launching a Bootstrap modal with Backbone has proven to be a huge pain in the ass. </p>
  
  <p>Here is what is in my HTML file:</p>
  
  <pre><code>&lt;body&gt;
  &lt;div id="teamSnapImportDiv"&gt;&lt;/div&gt;
  &lt;script&gt;
  
      function importFromTeamSnap(event) {
          event.preventDefault();
          alert('agegage');
          var aimportTeamSnapView = new importTeamSnapView({el: $("#teamSnapImportDiv")});
          var rendered = aimportTeamSnapView.render();
          //$(rendered.el).appendTo(this.$el).hide().fadeIn().slideDown();
      };
  
  &lt;/script&gt;
  
  
  &lt;script type="text/html" id="teamsnap-import-template"&gt;
  
          &lt;div class="modal fade"&gt;
              &lt;div class="modal-dialog"&gt;
                  &lt;div class="modal-content"&gt;
                      &lt;div class="modal-header"&gt;
                          &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
                          &lt;h4 class="modal-title"&gt;Modal title&lt;/h4&gt;
                      &lt;/div&gt;
                      &lt;div class="modal-body"&gt;
                          &lt;p&gt;One fine body&amp;hellip;&lt;/p&gt;
                      &lt;/div&gt;
                      &lt;div class="modal-footer"&gt;
                          &lt;button id="cancelTeamSnapImport" type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                          &lt;button id="confirmTeamSnapImport" type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;&lt;!-- /.modal-content --&gt;
              &lt;/div&gt;&lt;!-- /.modal-dialog --&gt;
          &lt;/div&gt;&lt;!-- /.modal --&gt;
  
  
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>here is my Backbone view:</p>
  
  <pre><code>var importTeamSnapView = Backbone.View.extend({
      tagName: "div",
      id: 'teamSnapImportDiv',
      initialize: function() {
      },
      render: function (){
          var importTeamSnapTemplate = document.getElementById('teamsnap-import-template').innerHTML;
          this.$el.html(_.template(importTeamSnapTemplate)());
      }
  });
  </code></pre>
  
  <p>What on earth do I need to do to make this work? I can get other stuff to work, but the modal thing is not working. Other examples do not make it clear what needs to get done, or why.</p>