hey I've been can't tell what I'm missing here, any suggestions?.. trying to get it so that this function is run each time someone clicks a link that leads them to another page in my site and this is my attempt to make this script external so that when someone goes to one of those pages it runs the script only until they enter the correct password and after the correct password is entered they don't have to do it again until they leave the site and come back again:
script: (passscript.js)
function passcheck(page) {
for (var password==""){
password = prompt("Please enter the password", "");
if (password!="sample password"){
window.location="filepath/test.html"
}
else{
window.location="filepath/" + page + ".html"
break;
}
}
}
html: (test.html)
<html>
<head>
<title>Title</title>
<script language="javascript" src="passscript.js">
</script>
</head>
<body>
<a href="test2.html" onclick="passcheck('test2')" />next page</a>
</body>
</html>


Reply With Quote

Bookmarks