title: Jquery functions not working in a modal of Bootstrap
body: <p>I use Bootstrap v2.X in my proyect and I want to open a file external using modal function.</p>
  
  <p>First, the code I should use is:</p>
  
  <pre><code>&lt;a href="view_graphics.php" class="btn btn-warning btn-large" data-toggle="modal"&gt;Graphics&lt;/a&gt;
  </code></pre>
  
  <p>but it doesn't work for me. Then I use:</p>
  
  <pre><code>&lt;a href="view_graphics.php" id="graphics" class="btn btn-warning btn-large"&gt;Graphics&lt;/a&gt;
  </code></pre>
  
  <p>and I put code Jquery:</p>
  
  <pre><code>$('a#graphics').click(function(e) {
              e.preventDefault();
              var url = $(this).attr('href');
              if (url.indexOf('#') == 0) {
                  $(url).modal('open');
              } else {
                  $.get(url, function(data) {
                      $('&lt;div class="modal hide fade modal-graphics"&gt;' + data + '&lt;/div&gt;').modal();
                  }).success(function() { $('input:text:visible:first').focus(); });
              }
          });
  </code></pre>
  
  <p>And It works!.</p>
  
  <p>Well, but it doesn't the principal problem. The problem is when the modal is open, don't work my code jQuery. </p>
  
  <p>This is my modal external:</p>
  
  <pre><code>&lt;div class="modal-header"&gt;
      &lt;a class="close" data-dismiss="modal"&gt;x&lt;/a&gt;
      &lt;h3&gt;Titulo modal&lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="modal-body"&gt;
      &lt;div class="window"&gt;
          &lt;div class="nom_epi"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="modal-footer"&gt;
      &lt;a class="btn btn-primary" href="javascript:print();"&gt;Imprimir&lt;/a&gt;
      &lt;a class="btn" data-dismiss="modal"&gt;Cerrar&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If I put the code in the file original:</p>
  
  <pre><code>$(document).ready(function() {
  $('.nom_epi').click(function() { alert("hello"); });
  });
  </code></pre>
  
  <p>It doesn't work!
  The external modal ignores Jquery code of the original file. It's strange because the bootstrap CSS interpreted good.</p>
  
  <p>I think it is due to the jQuery code I use to open the external modal.</p>