title: Jquery loop with AJAX, looping through bootstrap modal
body: <p>I am getting data from database, looping trough it and appending to the div in html page. It works until I am looping trough function witch contains <strong>bootstrap</strong> <code>MODAL</code>. I am passing parameters to function  but every <code>MODAL</code> that was created display first row of my <code>database table</code>. My goal is to loop trough my <code>function(MODAL)</code> and pass different rows of my table, not only the first one. </p>
  
  <p>VARIBLE WITH MY HTML</p>
  
  <pre><code>var table = {
          createTable: function(result) {
              $.each(result, function(i, column) {
                      $("#loopRows").append(
                          '&lt;tr id="post"&gt;&lt;td&gt;' + column.ID + '&lt;/td&gt;' +
                          '&lt;td&gt;' + column.Title + '&lt;/td&gt;' +
                          '&lt;td&gt;&lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#details"&gt;Details&lt;/button&gt;+showBookmark.showItemTemplate(column.Title, column.Url, column.User)+&lt;/td&gt;'
                      });
              }
          }
  </code></pre>
  
  <p>AJAX REQUEST</p>
  
  <pre><code>$(document).ready(function() {
      $.ajax({
          type: "GET",
          url: 'http://localhost:62795/api/bookmarks',
          success: function(result) {
              table.createTable(result);
          }
      });
  });
  </code></pre>
  
  <p>BOOTSTRAP MODAL WITH HTML FORM </p>
  
  <pre><code>var showBookmark = {
      showItemTemplate: function(title, url, user) {
          return '&lt;div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"   id="details"&gt;' +
              '&lt;label for="recipient-name" class="control-label"&gt;   Title:' + title + '&lt;/label&gt;' +
              '&lt;label for="message-text" class="control-label"&gt;   Url:' + url + '&lt;/label&gt;' +
              '&lt;label for="message-text" class="control-label"&gt;   User:' + user + '&lt;/label&gt;' +
              '&lt;/div&gt;'
      }
  }
  </code></pre>