Skip to content

Instantly share code, notes, and snippets.

@NemoPeti
NemoPeti / bootstrap3-alert-box.js
Created August 11, 2017 09:08 — forked from jnormore/bootstrap3-alert-box.js
Bootstrap 3 alert and confirm modals. Overrides window.alert normally, but window.confirm override requires a callback function to be passed to get result. Optional arguments for modal title and confirm button label.
window.alert = function(message, title) {
if($("#bootstrap-alert-box-modal").length == 0) {
$("body").append('<div id="bootstrap-alert-box-modal" class="modal fade">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header" style="min-height:40px;">\
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\
<h4 class="modal-title"></h4>\
</div>\
<div class="modal-body"><p></p></div>\