I have an empty modal on my page and I'm performing an ajax call as below (simplified for reading)
function returnIt(x)
{
$.ajax({
type:"POST",
url:"link",
data:{id:"123"},
success: function(data)
{
data=JSON.parse(data);
var content=document.getElementById("returnItModalBody").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);
$("#returnItModal").modal('show');
}
});
}
When I tell the script to alert with content
it shows it should show in modal.
When modal opens, there is nothing in its body.
What am I missing here?
Thanks