I have this code to load dynamic data from a remote file into bootstrap using jquery ajax:
JS:
$(function(){
$('.push').click(function(){
var essay_id = $(this).attr('id');
$.ajax({
type : 'post',
url : 'your_url.php',
data : 'post_id='+ essay_id,
success : function(r)
{
$('#mymodal').show();
$('.something').show().html(r);
}
});
});
});
HTML:
<a href="#" id="1" class="push">click</a>
<div class="modal-body">
<div class="something" style="display:none;">
</div>
</div>
this worked for me, but the modal frame does not show until loading / pending data loading. I need to load a modal block after clicking, and then load the data.
How to fix it?!
source
share