简体   繁体   English

手机上的Java键盘按下

[英]Javascript keydown on mobile phone

I have some problem with this code 我的代码有问题

<input type="text" id="search-qq">
<script>
$('#search-qq').keypress(function(event) {alert('key pressed');});
</script>

This code working on my computer, but Why this code don't work on my android(default browser, android 2.3.6)?? 此代码在我的计算机上有效,但是为什么此代码在我的android(默认浏览器,android 2.3.6)上不起作用?
在此处输入图片说明

Maybe the reason is alert is for javascript, and in Android it may use AlertDialog not alert ? 也许原因是alert是针对javascript的,而在Android中可能使用AlertDialog而不是alert And not any code can run in web can also run in mobile, if you want to code mobile website, you should use jQuery mobile instead, look this: JQuery Mobile 而且没有任何代码可以在Web中运行,也不能在移动设备中运行,如果您要对移动网站进行编码,则应改用jQuery mobile,如下所示: JQuery Mobile

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM