[英]IBM Worklight 6.0 - Hybrid Android Application not working in Emulator and Device
[英]IBM Worklight 6.0 - jQuery Mobile page linking not working in the Android emulator
使用Worklight 6.0,我已經在Android環境中創建了一個應用程序,並且正在使用jQuery Mobile。
通過Worklight Console預覽應用程序的公共環境時,頁面鏈接可以完美地工作。 但這在Android模擬器中不起作用。 每當我單擊“提交”按鈕時,都會刷新同一頁面。
這是我的代碼:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>SaskenV1</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link href="jqueryMobile/jquery.mobile-1.1.2.css" rel="stylesheet">
<link rel="stylesheet" href="css/SaskenV1.css">
<script>window.$ = window.jQuery = WLJQ;</script>
<script src="js/jquery.js"></script>
<script src="jqueryMobile/jquery.mobile-1.1.2.js"></script>
<link
href="jqueryMobile/jquery.mobile-1.1.2.css"
rel="stylesheet">
</head>
<body id="content" style="display: none;">
<div data-role="page" id="page1">
<div data-role="content" style="padding: 15px">
<div data-role="fieldcontain" id="fieldcontain">
<label for="text">Username:</label><input type="text" name="text" id="name">
</div>
<div data-role="fieldcontain" id="fieldcontain0">
<label for="text0">Password:</label><input type="text"
name="text0" id="pass">
</div>
<div class="ui-grid-a">
<div class="ui-block-a">
<a href="#" data-role="button" id="cancel">Cancel</a>
</div>
<div class="ui-block-b">
<a href="#page2" data-role="button" id="submit">Submit</a>
</div>
</div>
</div>
</div>
<div data-role="page" id="page2">
<div data-role="header">
<a href="SaskenV3.html" data-icon="home">Home</a>
<h6>2nd Page</h6>
<a data-rel="back" data-icon="back">Go back</a>
</div>
<div data-role="content">
<a href="#page1">Return to Page 1</a>
</div>
<div data-role="footer">
<h2>Footer Content</h2>
</div>
</div>
<script src="js/initOptions.js"></script>
<script src="js/SaskenV1.js"></script>
<script src="js/messages.js"></script>
</body>
</html>
每當用戶點擊“提交”按鈕時,我都想轉到#page2。 不知道為什么它不起作用...
更新:
現在,我發現我在html文件中所做的任何更改根本不會影響Android項目。 即使我也建立了那個。
這對我來說很好。
我已經在Worklight 6.0.0.1中執行以下操作:
myProject\\apps\\myApp\\common\\myApp.html
我用您的內容替換了BODY
元素的內容(當然,底部的3個腳本引用除外) Run As > Build All and Deploy
Run As > Android application
該應用程序隨后在Android模擬器中啟動。
輸入一些文本並單擊“提交”按鈕后,頁面切換到第二頁。
確保您遵循上述內容。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.