[英]Spellcheck enabled in Hybrid Mobile application
I am building a mobile application that uses the following technologies 我正在构建使用以下技术的移动应用程序
And I want to enable the spelling autocorrect that autmoatically fixes obvious spelling mistakes 我想启用自动纠正明显的拼写错误的拼写自动更正
such as fixing Teh automatically into The 例如将Teh 自动修复为
What kind of a plugin will do the job? 什么样的插件可以完成这项工作? Or what should I add in my code? 还是我应该在代码中添加什么?
The HTML5 of my mobile application 我的移动应用程序的HTML5
<textarea name="textarea-1" id="desiredpart" spellcheck="true" autocorrect="on" ></textarea>
And then in my JavaScript 然后在我的JavaScript中
$( document ).ready(function( ) {
$desiredpart = $("#desiredpart");
$desiredpart.attr("spellcheck","on").attr("autocorrect","on");
});
And my JavaScript is imported after the jQuery mobile file loads. 而且我的JavaScript是在 jQuery移动文件加载后导入的。
I read that jQuery mobile disables autocorrect and spellcheck. 我读到jQuery mobile禁用了自动更正和拼写检查。 Should I modify the jQuery mobile source code? 我应该修改jQuery移动源代码吗?
Below is a snippet of the code from http://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.js 以下是http://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.js中的代码段 You can playaround these lines and see the results in various devices. 您可以在这些行之间四处移动,并在各种设备中查看结果。
I would suggest you stick to the HTML attribute option as it has lower overhead on the DOM. 我建议您坚持使用HTML属性选项,因为它在DOM上的开销较低。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.