On my MediaWiki site, my goal is to display a bootstrap 4 alert for new visitors on specific pages, and have it stay permanently dismissed after it is closed. The alert will be transcluded to multiple pages, but once dismissed, it should not reappear on any of them. I have come across various solutions for this issue, but since I have no understanding of javascript, I am struggling to implement them effectively. Even after attempting to copy and paste the solutions, the alert continues to reappear when the page is refreshed or revisited. Below is the basic code I have been working with:
<div style="border: 1px solid black; border-radius: 10px; color: black; background: white; padding: 10px 25px 10px 15px; max-width: 600px;" class="alert alert-success alert-dismissible"><span style="font-size: 1em; color: white; background: blue; border-radius: 20px; padding: 8px;" class="close" data-dismiss="alert" aria-label="close">Dismiss</span>Testing text.</div>
I have attempted to resolve this issue by exploring the following resources:
- My Bootstrap alert will not display after being closed
- Using Bootstrap, have alert box remember close action
- Bootstrap 4 alert permanently closed with a cookie
Unfortunately, none of the solutions I have tried so far have successfully prevented the alert from reappearing after a page refresh or revisit.