Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/465.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript keypress/keyup在chrome移动浏览器上不起作用_Javascript_Jquery_Asp.net Mvc_Validation_Mobile Browser - Fatal编程技术网

Javascript keypress/keyup在chrome移动浏览器上不起作用

Javascript keypress/keyup在chrome移动浏览器上不起作用,javascript,jquery,asp.net-mvc,validation,mobile-browser,Javascript,Jquery,Asp.net Mvc,Validation,Mobile Browser,我一直在基于web的Asp.NETMVC应用程序中使用jquery,当我使用chrome mobile测试我的工作时,我发现jquery基于keypress/keyup的功能不起作用 我不知道为什么它不能在移动浏览器上运行。它在桌面浏览器上正常工作 谁能解决我的问题,提前谢谢 这对我很有用: 守则: <textarea name="textarea" id="txtComments" rows="3" onkeyup='return fnMaxLength(this,"5");' sty

我一直在基于web的Asp.NETMVC应用程序中使用jquery,当我使用chrome mobile测试我的工作时,我发现jquery基于keypress/keyup的功能不起作用

我不知道为什么它不能在移动浏览器上运行。它在桌面浏览器上正常工作

谁能解决我的问题,提前谢谢

这对我很有用:

守则:

<textarea name="textarea" id="txtComments" rows="3" onkeyup='return fnMaxLength(this,"5");' style="width: 940px" ></textarea> 

}

另外,感谢@FedericoklezCulloca的可能副本
if (field.value.length >= maxChars) { 

    var object = "-More than " + maxChars + " characters have been entered.";

    //errorAlert("error", "Maximum length error", object);

    alert(object);

    return false; 

}