Jquery不在android棒棒糖中工作.. [英] Jquery not working in android lollipop..

查看:77
本文介绍了Jquery不在android棒棒糖中工作..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用jquery验证整数和其他检查,如手机,密码等。

它的工作绝对没问题在网络浏览器中。但是当我在android浏览器或者android chrome中进行测试时它只是不工作。







我在谷歌搜索但没有找到任何合适的解决方案。



我尝试过:



我使用下面这个代码:

Hi,

I am using jquery validation for integers and other checking like mobile, pin code etc.
Its working absolutely fine in web browser. But when I am testing it in android browser or android chrome its just not working.



I searched in Google but did't found any suitable solutions.

What I have tried:

I used this bellow code:

function validate(evt) {
        var theEvent = evt || window.event;
        var key = theEvent.keyCode || theEvent.which;
        key = String.fromCharCode(key);
        var regex = /[0-9]/;
        if (!regex.test(key)) {
            theEvent.returnValue = false;
            if (theEvent.preventDefault) theEvent.preventDefault();
        }
    }







<input type="text" class="txtForexAmt" placeholder="0" value="@Model.TotalNoOfUnit" maxlength="10" />

推荐答案

这是一个已知问题。您是否尝试过其他设备的浏览器?这是棒棒糖的android WebView,表现得像那样。卸载webview也可以解决这个问题。
Its a known issue. Did you try any other browser of your device? It is the android WebView for lollipop which behaves like that. Uninstalling the webview could also fix the thing.


这篇关于Jquery不在android棒棒糖中工作..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆