所以,我有代碼,它沒有完成,但我希望它做的是顯示一個警告框,如果我寫'幫助'這個詞,並說別的東西,如果還有其他東西輸入。如果在JavaScript語句總是爲真
function prompter() {
var reply = prompt("This script is made to help you learn about new bands, to view more info, type help, otherwise, just click OK")
if (reply === 'help' || 'Help')
{
alert("This script helps you find new bands. It was originally written in Python 3.0.1, using Komodo IDE, but was then manually translated into Javascript. Please answer the questions honestly. If you have no opinion on a question, merely press OK without typing anything.")
}
else
{
alert("Press OK to continue")
}
};
但是,發生了什麼,是無論什麼時候,第一個警告框彈出,即使按取消! 我應該如何解決這個問題?
我敢打賭,這發生在很多人身上......偉大的問題,我從來沒有見過這裏在這裏! – Purag 2012-02-15 23:30:12