简体   繁体   中英

Spellcheck enabled in Hybrid Mobile application

I am building a mobile application that uses the following technologies

  • HTML5 / CSS3 / JavaScript
  • jQuery and jQuery Mobile
  • Cordova

And I want to enable the spelling autocorrect that autmoatically fixes obvious spelling mistakes

such as fixing Teh automatically into The

What kind of a plugin will do the job? Or what should I add in my code?

The HTML5 of my mobile application

<textarea name="textarea-1" id="desiredpart" spellcheck="true" autocorrect="on" ></textarea>

And then in my JavaScript

$( document ).ready(function( ) {
    $desiredpart = $("#desiredpart"); 
    $desiredpart.attr("spellcheck","on").attr("autocorrect","on");
});

And my JavaScript is imported after the jQuery mobile file loads.
I read that jQuery mobile disables autocorrect and spellcheck. Should I modify the jQuery mobile source code?

Below is a snippet of the code from http://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.js jQuery Mobile自动更正功能 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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