2016-04-28 63 views
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(); 
    } 
} 
+0

似乎在为我工作chrome - https://jsbin.com/bonebegazi/edit?html,js,output –

回答

0

看起来你选中了“不要再问我了”复选框,当Chrome上alert()This answer似乎解决内部Chrome浏览器的问题。