When I load the contents of the Bootstrap popper using ajax, the popover does not appear.
JavaScript:
var id = 1; $.post("load.php?pageid", { pageid:id; }, function(data,status){ document.getElementById("body").innerHTML=data; });
HTML response:
<a href="#" id="example" class="btn btn-danger" rel="popover" data-content="It so simple to create a tooltop for my website!" data-original-title="Twitter Bootstrap Popover">hover for popover</a> <script> $(function () { $("#example").popover(); }); </script>
When I put the HTML response above directly into the <body id="body"></body> code, popover works fine. I donβt understand what is going on here.
javascript jquery html ajax twitter-bootstrap
user3377041
source share