title: How do I apply Bootstrap tooltip to ajax-loaded content?
body: <p>I'm calling the following funciton on <code>ready()</code>. This predictably displays the Bootstrap tooltip for elements on my page that exist at <code>ready()</code> time, but not on ajax-loaded elements. I now am needing to have tooltips work on ajax-loaded content as well. How would I re-write this to allow new ajax-loaded elements to have the proper behavior?</p>
  
  <pre><code>$(document).ready( function() { 
    give_bootstrap_tooltip_behavior_to_all_elements_with_tooltip_attribute();
  });
  
  function give_bootstrap_tooltip_behavior_to_all_elements_with_tooltip_attribute() { 
    $( "[data-toggle='tooltip']" ).each(function(k,el){
      defaults = {
        delay: { show: 2000, hide: 0},
        container: 'body' /* needed because otherwise tooltips sometimes go within elems that have overflow hidden */
      }
      inline_vals = {
        delay: $(el).data('delay') 
      }
      $(el).tooltip($.extend(defaults, inline_vals));
    }); 
  }
  </code></pre>
  
  <p>Would I have to call this in every ajax success method?</p>