I have been a happy lurker for some time now, soaking in the abundant knowledge that i have found here. But now I am at my wits end trying to find the solution to what is probably a novice’s oversight.
I have a menu that animated with jquery. One of the link I have added js call a function that asks for a quick password then opens new page. Some reason it only seems to refresh the page. Here's the code involved.
the js
function password(){
var password;
var pass1="cool";
password=prompt('Please enter your password to view this page!',' ');
if (password==pass1)
alert('Password Correct! Click OK to enter!');
else
{
//window.location.href = "www.google.com";
window.location="www.google.com";
}
}
and the html
<a href="" onclick="password()">Password</a>
I used Google as a reference to ensure my site wasn't posing any addiction problems. From everything I have read online and offline window.location should be so complicated. If I need to include more context let me know. Thanks for any insight/help.