我将我的Android应用程序从cordova-1.6.1升级到cordova-2.5.0。此外,我从jquery.mobile-1.1.0升级到jquery.mobile-1.3.0.js。我在Android 2.3.3上运行我的应用程序。第一页,index.html是一个启动画面,在3秒后进入页面login.html。第一页,启动页面显示正确,但第二页显示为空白,即使我链接到第一页的其他页面。这一切在升级之前都有效。我更进了一步,将我的所有login.html页面内容复制到index.html,它显示我的登录表单正确。然后,无论下一页要显示,它都会显示为空白。这是我正在使用的代码:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>AFitnessPal</title>
<script src="jquery.mobile/jquery-1.9.0.js"></script>
<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.3.0.css" />
<script src="jquery.mobile/jquery.mobile-1.3.0.js"></script>
<script type="text/javascript" charset="utf-8" src="javascripts/cordova-2.5.0.js"></script>
<script type="text/javascript" charset="utf-8" src="javascripts/DBAdapter.js"></script>
</head>
<body>
<div data-role="page" id="indexpage" data-dom-cache="false">
<div data-role="header" data-position="inline">
<h1>AFitnessPal</h1>
</div>
<div data-role="content">
<ul id="LoginForm" data-role="listview">
<li data-role="fieldcontain"><label for="name">Login
ID:</label> <input type="text" maxlength="100" name="loginID" id="loginID"
value="" /></li>
<li data-role="fieldcontain"><label for="name">Password:</label>
<input type="password" maxlength="100" name="loginPassword"
id="loginPassword" value="" /></li>
<li data-role="fieldcontain"><label for="slider2">Remember
login:</label> <select name="RememberLogin" id="RememberLogin"
data-role="slider">
<option value="0">No</option>
<option value="1">Yes</option>
</select></li>
<li class="ui-body ui-body-b">
<fieldset class="ui-grid-a">
<div class="ui-block-b">
<button onclick="javascript:DoLogin();" data-theme="a">Submit</button>
</div>
</fieldset>
</li>
<li class="ui-body ui-body-b">
<div align="center">
<a href="CreateAccount.html"> Create New Account</a>
</div>
</li>
</ul>
</div>
<script type="text/javascript" charset="utf-8">
function goToLogin()
{
$.mobile.changePage("Login.html", { transition: "flip"} );
}
$("#indexpage").on('pageinit', function(){
alert('login.html pageinit fired');
});
$("#indexpage").on("pageshow", function(e) {
alert('login.html pageshow fired');
});
</div>
</body>
</html>