【发布时间】:2014-07-30 19:02:55
【问题描述】:
我正在尝试学习如何同时使用 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 运行并且构建成功时,我得到了附加的图像输出:
而按钮应该是这样的:
当我在浏览器中打开 index.html(在 phonegap 应用程序目录内)时,我在控制台中得到以下信息:
我猜这是导致问题的原因。我需要你的支持来解决这个第一次遇到的问题(对我自己)。我下载了所有 jQuery 移动 zip 文件,并将所有文件放在 phonegap 应用程序的相应文件夹中。
谢谢,
【问题讨论】:
-
将
ui-btn-a或ui-btn-b添加到锚点。 -
另外,jquery-core 在哪里?
-
您缺少 jQuery 参考。在 JQM 引用之前添加 jQuery,这应该可以解决未捕获的类型错误
标签: javascript jquery jquery-mobile cordova