jquery on modal show
snippet in javascript

jquery on modal show

user1440

$(window).on('shown.bs.modal', function() { 
    $('#code').modal('show');
    alert('shown');
});