0

So earlier today this was working and I'm not getting any errors but now the prompt window just isn't appearing anymore.

The page is supposed to load up a prompt function onload. Since it broke I tried replacing the function with a simple alert() statement and even that won't pop up. It works fine in Safari. I can only think that there's something wrong with my Chrome settings rather than my code.

<body onload='funcPrompt();'></body>

JS

function funcPrompt() {
    var answer = prompt("Are you a photographer?", "Yes/No");

    if (answer === null || answer === "") {
        alert('Please enter an answer');
        funcPrompt();
        return;
    }

    answer = answer.toLowerCase();

    if (answer == "yes") {
        alert('Excellent! See our links above and below to see more work and find contact info!');
    } else if (answer == "no") {
        alert('That is okay! See our links above and below to learn more!');
    } else {
        alert('Sorry, that answer is not an option');
        funcPrompt();
    }
}
rafaelcpalmeida
  • 874
  • 1
  • 9
  • 28
Kogden
  • 46
  • 1
  • 2
  • 7

1 Answers1

0

Looks like you checked the "don't bug me anymore" checkbox that Chrome has on alert() This answer seems to fix that issue inside Chrome.

Community
  • 1
  • 1