Jquery plugins jQuery本地化不';你不适合jquerymobile吗?

Jquery plugins jQuery本地化不';你不适合jquerymobile吗?,jquery-plugins,jquery-mobile,cordova,jquery-localizer,Jquery Plugins,Jquery Mobile,Cordova,Jquery Localizer,我正在开发一个具有多种语言的PhoneGap web应用程序,我正在使用它来完成。我让它在一个简单的静态页面上运行,但当我将它与jQuery Mobile集成时,它就不起作用了 这是我的简单测试页面: <div data-role="page" id="pageHome"> <script type="text/javascript"> $("#pageHome").live('pagecreate', function() { $("[rel*=

我正在开发一个具有多种语言的PhoneGap web应用程序,我正在使用它来完成。我让它在一个简单的静态页面上运行,但当我将它与jQuery Mobile集成时,它就不起作用了

这是我的简单测试页面:

<div data-role="page" id="pageHome">
<script type="text/javascript">
    $("#pageHome").live('pagecreate', function() {
        $("[rel*=localize]").localize("index");
    });
</script>
<div data-theme="a" data-role="header">
    <h3>Home</h3>
    <div data-role="navbar" data-iconpos="top">
        <ul>
            <li><a href="#pageUne" rel="localize[one]" data-theme="" data-icon="home" class="ui-btn-active">no</a></li>
            <li><a href="#pageTwo" rel="localize[two]" data-theme="" data-icon="star">no</a></li>
            <li><a href="#pageThree" rel="localize[three]" data-theme="a" data-icon="check">no</a></li>
        </ul>
    </div>
</div>
<div id="content" data-role="content">
    <div><b>Welcome!</b></div>
</div>

$(“#pageHome”).live('pagecreate',function(){
$(“[rel*=本地化]”)。本地化(“索引”);
});
家
欢迎

我在PhoneGap控制台中看到下一条消息:

未捕获的SyntaxerError:处出现意外字符串


我尝试在事件pagebeforecreatepageInit中处理,但没有成功

以下是您问题的示例答案

如果有人在用英语寻找答案,请参阅以下链接:

JQM向DOM中添加了许多自己的东西,因此调用jquery本地化将破坏所有这些工作,导致奇怪的结果。要解决这个问题,请在JQM开始工作之前调用localize。上述链接中的一个示例:

$(document).on('pagecreate','#home',function(event){
      $("[rel*=localize]").localize("index")
});

HTMLed.js是专门为Jquery mobile开发的。重量轻。在GitHub上签出框架

也许这有帮助