|
Answer» I need to password protect a webpage so I use the following code, which works find in Explorer, CHROME and Firefox but returns password Incorrect in Safari.
Any Idea why or how to correct is desired.
function passWord() { var testV = 1; var pass1 = prompt('PLEASE Enter Your Password',' '); while (testV < 3) { if (!pass1) history.go(-1); if (pass1.toLowerCase() == "letmein") { alert('You Got it Right!'); window.open('protectpage.html'); break; } testV+=1; var pass1 = prompt('Access DENIED - Password Incorrect, Please Try Again.','Password'); } if (pass1.toLowerCase()!="password" & testV ==3) history.go(-1); return " "; }
You do realise anyone who views the source of the webpage will be able to see the password?
|