자바 스크립트와 if 루프를 사용하여 비밀번호를 확인합니다. 그러나 자바 스크립트가 아닌 문자열을 입력하면 경고가 표시되지 않습니다. 여기 내 코드가있다.자바 스크립트 비밀번호 검사기
<script type = "text/javascript">
function password_prompt() {
var password = window.prompt("Please enter the correct password ", ""); //password = javascript
if (password == "javascript") {
var x = window.confirm("Please confirm you want to enter the webpage!");
if (x != 1) {
window.close();
window.open("https://www.google.com/");
}
if (password != "javascript") {
window.alert("You entered the wrong password! Page will now close!");
window.close();
window.open("about:blank");
}
}
}
</script>
들여 쓰기 코드 당신이 볼 수 – BeyelerStudios
OT : 자바 스크립트위한 인증 나쁜 생각이 ... :) –
금지 된 암호가 나쁜 생각 –