Hi all, another probably simple fix im not seeing.
I have a set of variables that on the first page of my document i set in the local storage like this:
window.localStorage.setItem("sam", "Ready");
window.localStorage.setItem("fairy", "Ready");
window.localStorage.setItem("potion", "Ready");
window.localStorage.setItem("zombie", "Ready");
window.localStorage.setItem("dragon", "Ready");
window.localStorage.setItem("key", "NotReady");
window.localStorage.setItem("hunt", "NotReady");
then in diffferent pages these variables are used to determine events in functions, these events are one time only events and the variable needs to be rewritten once the event has been executed. This is my function:
function LaunchTask() {
var zombie = localStorage.getItem("zombie");
var key = localStorage.getItem("key");
if (zombie = "Ready") {
window.open("https://sulfurous.aau.at/legacy/html/app.html?id=237987220&turbo=false&full-screen=false&aspect-x=&aspect-y=&resolution-x=800&resolution-y=600","_blank", "location=yes,height=400,width=530,scrollbars=yes,status=yes");
zombie = localStorage.setItem("zombie", "Done");
key = localStorage.setItem("key", "Ready");
} else {
alert("no more danger here!");
}
zombie = localStorage.getItem("zombie");
key = localStorage.getItem("key");
window.location.reload(true);
}
it reads the values of the variables at the start, but it fails to write over them and set a new value, meaning that the events keep happening every time i click the button which i dont want to happen.
can you guys help?