Javascript Password Prompt Errors
<p>I can't seem to figure out how to correct the 2 problems I'm running into. </p>

<p>Here is the code I am working with:</p>

<pre><code>function password() {
    var testV = 1;
    var pass1 = prompt('Please Enter The Password','');
    while (testV &lt; 2) {
        if (!pass1) 
            history.go(-1);
        if (pass1 == "default") { //password here
            window.open('http://www.[redacted].com/downloads/documents/12-2011-project.psd'); //if password correct
            break;
        } 
        testV += 1;
        var pass1 = 
            prompt('Incorrect - Please Try Again.',''); //if password incorrect
    }
    if (pass1 != "password" &amp; testV == 2)               
        history.go(-1);
    window.location = "/exit.html"; //redirects to here after success and opens download
}
</code></pre>

<p><strong>My first problem:</strong> 
When clicking "<em>Cancel</em>" it prompts again. I just want it to simply disappear after I click cancel. </p>

<p><strong>Second:</strong> 
After the 2 attempts are used when you click "<em>Cancel</em>", it redirects as if downloaded (no download is activated, which is good.)</p>

<p>What am I doing wrong, or what needs to be fixed?</p>

<p>Also, If a user just presses "OK" twice, there is no download activated, but it still redirects. I left a note on the exit page stating this. This doesn't bug me, but can that be fixed?; if not that's fine with me.  </p>

<p><strong>SOLVED</strong> (12/16 @ 9:30 AM)
Thanks to all that answered my first question!. </p>
