$(window).on('shown.bs.modal', function() {
$('#code').modal('show');
alert('shown');
});
show Modal:
----------------------------
$('#modal_id').modal('show');
hide and show Modal (toggle):
-----------------------------
$('#modal_id').toggle('modal');
$('#modal_id').modal('show');
.ui-dialog { z-index: 1100 !important ;}
Open bootstrap modal by jQuery