$('#moje_okno').on('show.bs.modal', function (e) { if (!data) return e.preventDefault() // wstrzymanie wyƛwietlania okna modalnego })