I\'m having trouble reloading content of a bootstrap popover with ajax. Here\'s some code: http://pastie.org/3960102
The second ajax request (when I click on \"a.close\"
This work form me: Inizialize popover on document ready (data is a json with HTML and size of element found)
$.ajax({
url: "/alpha/annuncio/scegliGestione",
success: function (data) {
$('#notifiche').popover(
{
title:"Le tue notifiche",
placement:'bottom',
trigger:'manual'
});
$('#notifiche').find(".badge").text(data.size);
}
});
On the trigger event of popover you must in sequence toggle the popover (show or hide instead), make popover-content empty and finally append data.html
$("#notifiche").click(function(){
$.get("/alpha/annuncio/scegliGestione", function(data) {
$('#notifiche').popover('toggle')
$("body").find('.popover-content').empty()
$("body").find('.popover-content').append(data.html);
$('#notifiche').find(".badge").text(data.size);
});
/* */
});