2016-04-28 61 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瀏覽器的問題。