Q
query
Gast
Ich habe den fetch-Teil schon in function checkKey() eingetragen, weil das so wohl sein soll, aber ich finde gerade keine Lösung zum Ziel...
Vielen Dank!
Vielen Dank!
Code:
function checkKey() {
const inputKey = inputKeyField.value;
fetch("main.js-key.txt")
.then(response => response.text())
.then(textData => {
console.log(textData);
})
.catch(error => {
console.error('Error:', error);
});
//const key = "1";
if (key === inputKey) {
alert("Der eingegebene Key ist richtig!")
downloadButton.classList.remove("hidden");
downloadDiv.classList.add("download-div");
loginform.classList.add("hidden");
} else if (document.getElementById("key").value == "") {
alert("Kein Key angegeben!")
} else {
/*downloadButton.classList.add("hidden");
downloadDiv.classList.remove("download-div");
comingsoon.classList.remove("hidden");
loginform.classList.remove("hidden");*/
alert("Der eingegebene Key ist falsch!")
history.back()
}
}