Javascript JS If语句不适用于android 4.4.2或iphone
在我的android或iPhone上,当我在电脑上输入glass时,我会得到else,它工作正常Javascript JS If语句不适用于android 4.4.2或iphone,javascript,android,iphone,Javascript,Android,Iphone,在我的android或iPhone上,当我在电脑上输入glass时,我会得到else,它工作正常 <script type="text/javascript"> var x = prompt("Wholesale users enter in the password or hit enter for consumer information "," "); if(x == "glass"){ window.alert("sometext"); } else {
<script type="text/javascript">
var x = prompt("Wholesale users enter in the password or hit enter for consumer information "," ");
if(x == "glass"){
window.alert("sometext");
}
else {
window.alert("else");
}
</script>
应该是
if(x == "glass"){
执行[x]时,您正在创建一个数组。因为您使用的是==检查,所以它将为真这不是真的
从评论中可以看出有20%的空白
更改提示,使其不包含空格
r information "," ");
到
在我的安卓系统或iPhone上,当我在电脑上输入glass时,我会得到另一个。它工作正常。对不起,我正在尽一切努力让它工作。它也不工作;它显示什么?这是你的答案,有一个空格!谢谢你的进一步解释!我已经排除了所有的可能性,而且成功了,所以我不确定到底是什么。。
r information "," ");
r information ","");