when open modal do something bootstrap 4 code example
Example 1: modal in bootstrap 4
$('#myModal').modal('toggle')
Example 2: bootstrap 4 modal popup remote url
$('body').on('click', '[data-toggle="modal"]', function(){
$($(this).data("target")+' .modal-body').load($(this).data("remote"));
});