Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jquery mobile未在phonegap应用程序中加载_Javascript_Jquery_Jquery Mobile_Cordova - Fatal编程技术网

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

Javascript jquery mobile未在phonegap应用程序中加载,javascript,jquery,jquery-mobile,cordova,Javascript,Jquery,Jquery Mobile,Cordova,我正在尝试学习如何同时使用jQuery mobile和phonegap。我有以下基本索引页: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="msapplication-tap-

我正在尝试学习如何同时使用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>

UIAdv
欢迎来到UIAdv
app.initialize();
在这里,我有下面一行,它应该使用jquery库呈现一个按钮:

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

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

而按钮应如下所示:

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

我猜这就是问题的根源。我需要你的支持来解决第一次遇到的问题。我下载了所有jQuery mobile zip文件,并将所有文件放在phonegap应用程序的相应文件夹中


谢谢,

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


UIAdv
欢迎来到UIAdv

添加
ui-btn-a
ui-btn-b
锚定。另外,jquery核心在哪里?您缺少jquery参考。在JQM引用之前添加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>