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 >
Text File  |  1998-08-25  |  1KB  |  47 lines

  1. <!-- TWO STEPS TO INSTALL THREE TRIES:
  2.  
  3.    1.  Put the first code into the BODY of your HTML document
  4.    2.  Change protectedpage.html to your protected filename  -->
  5.  
  6. <!-- STEP ONE: Copy this code into the BODY of your HTML document  -->
  7.  
  8. <BODY>
  9.  
  10. <SCRIPT LANGUAGE="JavaScript">
  11.  
  12. <!-- This script and many more are available online from -->
  13. <!-- The JavaScript Source!! http://javascriptsource.com -->
  14.  
  15. <!-- Begin
  16. function password() {
  17. var testV = 1;
  18. var pass1 = prompt('Please Enter Your Password','');
  19. while (testV < 3) {
  20. if (!pass1) 
  21. history.go(-1);
  22. if (pass1 == "password") {
  23. alert('You Got it Right!');
  24.  
  25. //  Change the following URL to your protected filename
  26.  
  27. window.open('protectedpage.html');
  28. break;
  29. testV+=1;
  30. var pass1 = 
  31. prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
  32. }
  33. if (pass1!="password" & testV ==3)               
  34. history.go(-1);
  35. return " ";
  36. }      
  37. document.write(password());
  38. </SCRIPT>
  39. <CENTER>
  40. <FORM>
  41. <input type="button" value="Enter Password Protected Area" onClick="password()">
  42. </FORM>
  43. </CENTER>
  44.  
  45. <!-- Script Size:  1.10 KB  -->
  46.