I am facing an issue with an empty modal on my webpage and an AJAX call that I am trying to execute as shown below (simplified for easier understanding).
function fetchContent(x)
{
$.ajax({
type:"POST",
url:"link",
data:{id:"123"},
success: function(data)
{
data=JSON.parse(data);
var content=document.getElementById("fetchContentModalBody").innerHTML;
for(var i=0;i<data.length;i++)
{
if(data[i]["nick"]==1)
content+="<p>"+data[i]["upd"]+"</p>";
else
content+="<p>"+data[i]["upd"]+"</p>";
}
alert(content);
$("#fetchContentModal").modal('show');
}
});
}
Even after setting the alert to display the content, the modal opens up blank without any content inside it.
I am not sure what I am missing here. Any help or suggestions would be greatly appreciated.
Thank you.