How to Make an Ajax Request when Twitter Bootstrap Alert is Dismissed
Twitter Bootstrap is an awesome CSS framework which speeds the UI development a lot.
I worked on one of my products (qSandbox.com) this weekend. I wanted to notify the user that their account has been upgraded. I wanted the message to be shown in the control panel. That's in addition to the email confirmation.
I save the user specific message in a folder and if that file exist it is shown to the user.
The message will expire within 24hours but I wanted if the user dismissed the message so it is deleted.
That way the user won't be bother with the message again.
The project uses Twitter Bootstrap 3.x so I used the dismissible alert which when clicked makes an ajax request to remove the message.
Here is a link to a working demo: https://gist.github.com/lordspace/d950dfbd81b4a7f7213a
Related