gpt4 book ai didi

javascript - jquery mobile 未在phonegap 应用程序中加载

转载 作者:行者123 更新时间:2023-12-03 12:09:07 25 4
gpt4 key购买 nike

我正在尝试学习如何一起使用 jQuery mobile 和phonegap。我有以下基本索引页:

<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />

<link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.external-png-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.icons-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.inline-png-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.inline-svg-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.theme-1.4.3.css" />


<title>UIAdv</title>
</head>
<body>
<div class="app">
<h1>Welcome to UIAdv</h1>
<a href="#" class="ui-btn ui-btn-inline">Anchor</a>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.4.3.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
</script>
</body>
</html>

其中我有以下行,应该使用 jquery 库呈现按钮:

        <a href="#" class="ui-btn ui-btn-inline">Do Something</a>

当使用phonegap run ios运行应用程序并且构建成功时,我得到附加的图像输出:

enter image description here

而按钮应该如下所示:

enter image description here

当我在浏览器中打开index.html(在phonegap应用程序的目录中)时,我在控制台中看到以下内容:

enter image description here

我猜这就是导致问题的原因。我需要你的支持来解决这个第一次遇到的问题(对我自己)。我下载了所有 jQuery mobile zip 文件,并将所有文件放置在 PhoneGap 应用程序的相应文件夹中。

谢谢

最佳答案

cordova.js 脚本标记应位于 header 中。此外,您还需要检查应用程序的 www 目录中是否存在 cordova.js 文件。我已经重写了html文件。您可以使用下面的代码来测试您的 jquery 移动应用程序。快乐编码!

<html>
<head>
<title>UIAdv</title>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<!-- link rel="stylesheet" type="text/css" href="css/index.css" /-->

<link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.external-png-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.icons-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.inline-png-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.inline-svg-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.4.3.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.theme-1.4.3.css" />

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.4.3.js"></script>
<!-- script type="text/javascript" src="js/index.js"></script -->
<!-- script type="text/javascript"> app.initialize(); </script -->
</head>
<body>
<div class="app">
<h1>Welcome to UIAdv</h1>
<a href="#" class="ui-btn ui-btn-inline">Anchor</a>
</div>
</body>
</html>

关于javascript - jquery mobile 未在phonegap 应用程序中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25044864/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com