首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我必须同时保存印地语和英语字段,同时用户将键入

我必须同时保存印地语和英语字段,同时用户将键入
EN

Stack Overflow用户
提问于 2016-05-23 12:18:37
回答 1查看 712关注 0票数 0

如果用户输入印地语,文本应该填写在另一个文本文件上,这样我就可以保存以进一步检索。当我输入并给出空间时,下面的代码将立即转换为英语或印地语。Please.help我保留印地语和英语的信息。

代码语言:javascript
复制
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>  
    <link href="http://www.google.com/uds/modules/elements/transliteration/api.css" type="text/css" rel="stylesheet"/>

    <script type="text/javascript">
      // Load the Google Transliteration API
      google.load("elements", "1", {
            packages: "transliteration"
          });
      function onLoad() {
        var options = {
            sourceLanguage:
                google.elements.transliteration.LanguageCode.ENGLISH,
            destinationLanguage:
                [google.elements.transliteration.LanguageCode.HINDI],
            shortcutKey: 'ctrl+g',
            transliterationEnabled: true
        };

        // Create an instance on TransliterationControl with the required
        // options.
        var control =
            new google.elements.transliteration.TransliterationControl(options);

        // Enable transliteration in the textbox with id
        // 'transliterateTextarea'.
        control.makeTransliteratable(['transliterateTextarea']);
      }
      google.setOnLoadCallback(onLoad);
    </script>
  </head>
  <body>

    Type in Hindi (Press Ctrl+g to toggle between English and Hindi)<br>
    <a href="#" onclick="document.getElementById('Wrapper').style.display = 'block'; return false;">show textarea</a>
    <div id="Wrapper" style="display:none"> <h2> Textarea </h2>
    <textarea id="transliterateTextarea" style="width:600px;height:200px"></textarea>
    <textarea id="transliterateTextarea2" style="width:600px;height:200px"></textarea>
    </div>
  </body>
</html>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-05-23 12:36:15

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37390851

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档