$(document).ready(function() {
$('[data-toggle="popover"]').popover({
title: fetchData,
html: true,
placement: 'right'
});
// here is the function for the ajax
function fetchData() {
var fetch_data = '';
var element = $(this);
var id = element.attr("id");
$.ajax({
url: "fetch.php",
type: "GET",
// async:false,
data: {
id: id
},
success: function(data) {
fetch_data = data;
});
return fetch_data;
}
});