$('#MymodalPreventScript').modal({ backdrop: 'static', keyboard: false });
$('#myModal').on('hidden.bs.modal', function () { // do something… });