title: get ajax data and display on bootstrap modal
body: <p>Im building an app the hosts restaurant menus. When a menu item is clicked i want to fetch the item's data from my api via ajax and display it on a bootstrap modal. </p>
  
  <p>javascript</p>
  
  <pre><code>(function() {
  var infoModal = $('#myModal');
  $('.modal-toggle').on('click', function(){
      $.ajax({
          type: "GET",
          url: '/api/menu-item/'+$(this).data('id'),
          dataType: 'json',
          success: function(data){
              var item = JSON.parse(data);
              var htmlData = '&lt;ul&gt;&lt;li&gt;';
              htmlData += item.name;
              htmlData += '&lt;/li&gt;&lt;/ul&gt;';
              infoModal.find('#modal-body').innerHTML = htmlData;
          }
      });
      infoModal.modal();
  });
  })(jQuery);
  </code></pre>
  
  <p>the modal trigger</p>
  
  <pre><code>&lt;a class="modal-toggle" data-toggle="modal" data-target="#myModal" data-id="{{{ $item-&gt;id }}}"&gt;&lt;h5&gt;{{{ $item-&gt;name }}}&lt;/h5&gt;&lt;/a&gt;
  </code></pre>
  
  <p>the modal</p>
  
  <pre><code>&lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-      labelledby="exampleModalLabel" aria-hidden="true"&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" id="exampleModalLabel"&gt;New message&lt;/h4&gt;
    &lt;/div&gt;
    &lt;div class="modal-body" id="modal-body"&gt;&lt;/div&gt;
    &lt;div class="modal-footer"&gt;
      &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
      &lt;button type="button" class="btn btn-primary"&gt;Add to cart&lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>the apis response</p>
  
  <pre><code>{"id":4,"menu_category_id":446,"name":"kunzereichert","description":"Dolores impedit ut doloribus et a et aut.","price":"999.99","created_at":"2015-04-10 05:55:23","updated_at":"2015-04-10 05:55:23"}
  </code></pre>
  
  <p>when i click on the trigger the modal pops up and the ajax request appears on my browsers networks with a status code of 200, however the modals inner html is not updated. I know theres probably docens of these questions here, but i couldnt seem to find one that helped. please help</p>