我今天就開始使用javascript了。嘗試與非常基本的,並堅持與If Else循環。Javascript if if condition run time failure
var input = prompt("type your name"); //variable stores the value user inputs var outout = tostring(input); // the input value is changed to string datatype and stored in var output alert(output);//supposed to display the value which it doesn't if(output == "Tiger") {alert("It is dangerous"); } Else {alert("all is well"); }//I only get a blank page
如果我省略了行var輸出= tostring(輸入)並嘗試顯示具有輸入值的警報框,我會看到警報框。但之後我只能看到一個空白頁面。 If Else循環根本不起作用。我正在使用記事本++。也在Dreamweaver中檢查。沒有編譯錯誤。我究竟做錯了什麼? 對不起,這個基本的問題,謝謝你的回覆。
問候, TD
的Javascript關鍵字和標識符是區分大小寫的。 – SLaks