Hello I am trying to show "Loading..." text or spinner image until the dynamic ajax content loads because I have a very large number of data to fetch with takes at least 2-3 seconds to fully load here is my Ajax code
$(document).ready(function(){
$('[data-toggle="popover"]').popover({
trigger: "hover",
title:fetchData,
html:true,
placement:'right'
});
function fetchData(){
var fetch_data = '';
var element = $(this);
var id = element.attr("id");
$.ajax({
url:"includes/modDashboard/GetSummaryInfo.php",
method:"POST",
async:false,
data:{id:id},
success:function(data){
fetch_data = data;
}
});
return fetch_data;
}
});