JQueryMobile与PhoneGap无法正常工作

时间:2016-02-17 13:51:42

标签: jquery-mobile

首先,我已经看到每一个问题都在Stack上说明了同样的问题,并且没有将它们应用于我的

我正在构建我的First PhoneGap应用程序,我想使用jQueryMobile库 无论如何,JQuery样式无法正常工作,

我的Index.html

<!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, target-densitydpi=device-dpi" />
        <link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.5.min.css" />

        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Hello World</title>
    </head>
    <body>
        <div data-role="page" data-theme="b">

            <div data-role="header">
                <h1>Welcome To My Homepage</h1>
            </div>

            <div data-role="main" class="ui-content">
                <a href="#" class="ui-btn ui-btn-inline ui-corner-all">btn1</a>
                <p>I Am Now A Mobile Developer!!</p>
                <a href="#" class="ui-btn ui-btn-inline  ui-corner-all">btn2</a>

            </div>

            <div data-role="footer">
                <h1>Footer Text</h1>
            </div>

        </div>
        <script type="text/javascript" src="cordova.js"/>
        <script type="text/javascript" src="./js/jquery-1.12.0.min.js"/>
        <script type="text/javascript" src="./js/jquery.mobile-1.4.5.min.js"/>
        <script type="text/javascript" src="js/index.js"/>
        <script type="text/javascript">
            app.initialize();
        </script>
    </body>
</html>

结果是 enter image description here

因为你可以看到内联和角落的按钮所有属性都运行正常但仍然不是预期的P

1 个答案:

答案 0 :(得分:0)

你没有正确引用它们 删除点。我遵循你的css文件所在的文件夹结构,你的java脚本文件应该在这里/ js not ./js

所以像这样参考 [代码]
 [/代码]

相关问题