我正在开发一个带有多种语言的PhoneGap web应用程序,我正在使用jQuery-Localize来完成。我在一个简单的静态页面上运行它,但是当我将它与jQuery-Mobile集成时,它不起作用。jQuery-Localize不适用于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>
我在PhoneGap的得到安慰的下一条消息:
Uncaught SyntaxError: Unexpected string at http://code.jquery.com/jquery-1.6.4.min.js:2
我试图在事件pagebeforecreate和处理pageInit没有成功