Password:<br>
<input type="password" name="password" id="thePassword"><br>
<button onclick="checkPassword();">Enter</button>
和:
function checkPassword() {
var pwd = document.getElementById("thePassword");
if (pwd.value=="admin") {
window.location.href="http://localhost/admin.html";
} else {
alert("INCORRECT PASSWORD!");
}
}
可以這樣成功的工作嗎? (我知道這是不安全的)(我沒有設置服務器)
是的。但是當我看到源代碼時,我會知道密碼。涼! –
是的,它會工作。請向我發送實施此強大安全性的網站的網址,以便我可以使用和濫用它。 –
大聲笑。我知道你會在源代碼中看到密碼。我只是確定。 – YoungCoder