提示未显示在镶边中

Prompts are not appearing in chrome

本文关键字:显示 提示      更新时间:2023-09-26

所以今天早些时候这是有效的,我没有收到任何错误,但现在提示窗口不再出现。

该页面应该加载一个提示函数加载。由于它坏了,我尝试用一个简单的 alert() 语句替换函数,即使它也不会弹出。它在 Safari 中工作正常。我只能认为我的Chrome设置而不是我的代码有问题。

<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();
    }
}

看起来您选中了Chrome在alert()上的"不要再打扰我"复选框 这个答案似乎解决了Chrome内部的问题。