Huh, that's one heck of a lot of overkill.
Code:
<script type="text/javascript">
do {
if(prompt("Enter the password:") === "cool")
window.location.href = "jex11.htm";
} while(confirm("Wrong password. Try again?"));
window.location.href = "jpass2.htm";
</script>
Note that this isn't at all secure, since anyone can look in your source and find the password, or even just find the URL and go there directly.
If you want a more secure client-side solution, see my script, but your best bet will always be a server-side script.
/EDIT: Cross-posted, sorry pcbrainbuster.
Let's see anyone say that's invalid !!!
It is: you're missing the type attribute on the <script> tag.
Bookmarks