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

Could not embed GitHub Gist d950dfbd81b4a7f7213a: Requires authentication

Related

 

 

Disclaimer: The content in this post is for educational purposes only. Always remember to take a backup before doing any of the suggested steps just to be on the safe side.
Referral Note: When you purchase through a referral link (if any) on this page, we may earn a commission.
If you're feeling thankful, you can buy me a coffee or a beer