此提示正常工作,直到我更新了其他一些JavaScript。我不知道我是如何搞砸的。該函數在body標籤中聲明以運行'onload'。Uncaught TypeError:無法讀取屬性'toLowerCase'爲空
function funcPrompt() {
var answer = prompt("Are you a photographer?", "Yes/No");
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 if(answer == null || answer == "") {
alert('Please enter an answer.');
funcPrompt();
}
else {
alert('Sorry, that answer is not an option');
funcPrompt();
}
}
現在突然我收到此錯誤,並且不會顯示提示。