As I create a static website without server-side functionality, my options are limited to HTML, CSS, and a few scripts.
Incorporated into each page is a popup script that I designed using JavaScript:
b = false;
if (!b) {
window.accept();
}
function accept() {
var r = confirm('By clicking you are ready to accept the condition');
if (r == true) {
x = "You pressed OK!";
b = true;
} else {
window.location = "http://google.com";
}
document.getElementById("demo").innerHTML = x;
}
My aim is for this popup to only appear once, so I've implemented a boolean variable that should change value after the user clicks OK. However, the popup continues to display despite my efforts.