Created
May 26, 2019 18:01
-
-
Save ttamg/325415efc03551ef45251c02d91c81dc to your computer and use it in GitHub Desktop.
Posts Bootstrap 4 style message to the #messages area of the DOM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Post messages | |
function postSuccessMessage(message) { | |
html = ` | |
<div class="alert alert-success fade show"> | |
<button type="button" class="close" data-dismiss="alert">×</button>`+ message + `</div>` | |
$('#messages').append(html); | |
setTimeout(function () { | |
$(".alert").alert('close'); | |
}, 3000); | |
} | |
function postErrorMessage(message) { | |
html = ` | |
<div class="alert alert-danger fade show"> | |
<button type="button" class="close" data-dismiss="alert">×</button>`+ message + `</div>` | |
$('#messages').append(html); | |
setTimeout(function () { | |
$(".alert").alert('close'); | |
}, 3000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment