Following Link Before Closing Bootstrap Alert
I am trying to close an alert after I click the link in it and we follow the link. What is happening is the alert is closing without following the link:
Solution 1:
You should be able to hook into the bootstrap event and it isn't that complicated. From documentation: bootstrap alerts. It will require an id or appropriate selector for the alert.
html
<div role="alert" class="alert alert-warning alert-dismissible" id="myAlert">
<button aria-label="Close" data-dismiss="alert" class="close" type="button">
<span aria-hidden="true">×</span></button>
A response has been updated. <a data-dismiss="alert" href="#main">Click here to view the update.</a>
</div>
js
<script>
$('#myAlert').on('closed.bs.alert', function () {
window.location.href = "http://www.google.com";
})
</script>
Post a Comment for "Following Link Before Closing Bootstrap Alert"