home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn WWW 1999 July
/
www_07_1999.iso
/
prez
/
amiga
/
KidHTML1_25.lha
/
KidHTML1.25
/
Script
/
threetries.js
< prev
next >
Wrap
Text File
|
1998-08-25
|
1KB
|
47 lines
<!-- TWO STEPS TO INSTALL THREE TRIES:
1. Put the first code into the BODY of your HTML document
2. Change protectedpage.html to your protected filename -->
<!-- STEP ONE: Copy this code into the BODY of your HTML document -->
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available online from -->
<!-- The JavaScript Source!! http://javascriptsource.com -->
<!-- Begin
function password() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "password") {
alert('You Got it Right!');
// Change the following URL to your protected filename
window.open('protectedpage.html');
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1!="password" & testV ==3)
history.go(-1);
return " ";
}
document.write(password());
</SCRIPT>
<CENTER>
<FORM>
<input type="button" value="Enter Password Protected Area" onClick="password()">
</FORM>
</CENTER>
<!-- Script Size: 1.10 KB -->