I have a MediaWiki site, and literally all I want to do is make a bootstrap 4 alert visible for any new visitors on certain pages, but stay permanently gone when it is dismissed. The alert would be transcluded to multiple pages, but if dismissed should no longer appear on any of them. I've found lots of answers for how to do this, but I don't understand javascript at all so I can't figure out how to use them, and copy/pasting the solutions isn't working. The alert displays and can be closed, but it's visible again if the page is refreshed/revisited. This is my very basic code:
<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've tried reversing this issue because I want it to stay closed: My Bootstrap alert will not display after being closed
I've tried copying this code but it didn't work with my alert: Using Bootstrap, have alert box remember close action
I've also tried copying the both cookie and local storage versions of this question's answer and it didn't work with my alert: Bootstrap 4 alert permanently closed with a cookie
Every single code I tried did not keep the alert from re-appearing every time after a refresh or a page revisit.
A dismissible alert its only for allow to close it, if you need display an alert and remember the choice, you need cookies or local storage and some javascript interaction like:
Tested ;)