Javascript password - remember the user's input -
Javascript password - remember the user's input -
i next js password script:
<script language="javascript"> var password; var pass1="hello"; password=prompt('please come in password view page!',' '); if (password==pass1 ) alert('password correct! click ok enter!'); else { window.location="test.html"; } </script>
i password remebered in pop-up box after user enters it, whether it's right or wrong.
or even... if user enters right password page 'remembers' (cookie) user has been successful , doesn't inquire password 1 time again until browser closed down.
i hope makes sense.
you can store authorisation status in cookies with:
document.cookie = 'authorized=1';
and later check with:
if (document.cookie.match(/\bauthorized=1\b/)) { //do }
javascript password-protection
Comments
Post a Comment