title: How to pass a string to a bootstrap modal?
body: <p>I'm not sure what I'm doing wrong, but I've searched in all "passing data to a bootstrap modal" posts, but still can't find the answer.</p>
  
  <p>I have a table with users. In each row there is a "delete user button". When you click on "delete", a modal shows up which the legend: "Are you sure you want to delete?"</p>
  
  <p>I want the username to be displayed in that legend, so I send the username to a JS file but it doesn't show. Nothing appears.</p>
  
  <p>This is the delete button in every row:</p>
  
  <pre><code>   &lt;td&gt;&lt;a href="#" onclick="callToModal({$frontuser-&gt;username});return false;" class="btn mini red-stripe" role="button" &gt;Delete&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p><br/>
  I'm using smarty that's why the parameter looks like this: <code>{$frontuser-&gt;username}</code></p>
  
  <p>Above that code, I have the definition of the modal:</p>
  
  <pre><code> &lt;!-- modal --&gt;
   &lt;div id="myModal3" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel3" aria-hidden="true"&gt;
         &lt;div class="modal-header"&gt;
              &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&lt;/button&gt;
               &lt;h3 id="myModalLabel3"&gt;&lt;/h3&gt;
         &lt;/div&gt;
         &lt;div class="modal-body"&gt;
                &lt;p&gt;&lt;/p&gt;                              
         &lt;/div&gt;
         &lt;div class="modal-footer"&gt;
               &lt;button class="btn" data-dismiss="modal" aria-hidden="true"&gt;Cerrar&lt;/button&gt;
               &lt;button data-dismiss="modal" class="btn blue" id="deleteok"&gt;Confirmar&lt;/button&gt;
         &lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- end modal --&gt;
  </code></pre>
  
  <p>Then my JS file is:
  </p>
  
  <pre><code>function callToModal(data) {
    $("#myModal3 .modal-header h3").html("Eliminar");
    $("#myModal3 .modal-body p").html("Are you sure you want to delete: ", data);
    $("#myModal3").modal("show");
  }
  </code></pre>
  
  <p><br/>
  Any help would be much appreciated!</p>