0
因此,今天早些时候这是工作,我没有得到任何错误,但现在提示窗口不再出现。提示未显示在铬合
该页面应该加载一个提示函数onload。自从它破裂后,我尝试用简单的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 - https://jsbin.com/bonebegazi/edit?html,js,output –