我今天就开始使用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