<div id="alerts" style="display:none;"></div>
$.alert("Ut oh, there was an error.", {'type': 'success'});
$.alert("Ut oh, there was an error.");
Default params as follows:
{
'type': 'danger',
'append': true,
'dismissable': true
}
This will be useful if you want to hide the #alerts
div while empty.
/**
* Hide the alerts container if there are no alerts left.
*/
$(document).on('click', 'button[data-dismiss="alert"]', function(){
if ($('#alerts').text() == "") {
$('#alerts').hide();
}
});