bootstrap modal popup example

bootstrap modal popup example on load.

by karthick6891

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
 <a href="#" data-toggle="popover" title="Popover Header" data-content="Loading....">Toggle popover</a>

JavaScript

$('[data-toggle="popover"]').popover();  
$('[data-toggle="popover"]').on('show.bs.popover', function () {
    $.ajax({
        url: "/echo/xml/",
        type: 'GET',
        success: function (data) {           
           	$('[data-toggle="popover"]').attr('data-content', "heelo ajax data")
                //these following three lines are firing correctly, just not doing what I want (refreshing the popover)
              var popover = $('[data-toggle="popover"]').data('bs.popover');
              popover.setContent();
              popover.$tip.addClass(popover.options.placement);
        }
    });
});